It is important to know the exact meaning of compassion. The Buddhist interpretation is that genuine compassion is based on a clear acceptance or recognition that others, like oneself, want happiness and have the right to overcome suffering.
On that basis one develops some kind of concern about the welfare of others, irrespective of their attitude to oneself. That is compassion.
H.H. Dalai Lama XIV