But it's not cheap. Even for a rich nation like KSA. I read an excellent article about 5 years ago on KSA's energy problems. It mentioned that about 20% of its electricity is spent on desalination plants. And most of the energy is being generated using fossil fuels. When the oil reserves will run out, KSA will be in for a unprecedented catastrophe.
KSA needs to do two things, try to get water resources by means other than desalination. Desalination is an extremely energy demanding process, and is not worth it
Secondly, they need to look for other ways to manufacture energy. I guess as you mentioned they are already looking at other ways, like solar and nuclear. But i think it's too little too late. Instead they need to find other ways to get water to their people. Maybe from Turkey?