The EV is by far the least polluting option. In a year or two of normal driving, even on a dirty grid, you generate less pollution than if you were burning fuel in the car.
Grids are getting lower carbon intensity every year, so it just gets better after that.
It's also not clear that rooftop solar is better than anything else, the carbon involved in getting it to you, installing it, the business that does the installation… It's not very efficient.