A small-caliber gun with a good fire-control system or a couple of marksmen should be a better answer. Asymmetric threats have been a major concern for modern armies at least since the first Gulf War. The threat used to be swarm of small boats. Now it's also swarm of UAV. Answers exist to both.
Regarding the most likely origin of a UAV swarm targetting a US carrier close to the shore of the USA, I will go with the US army. It's good way to test both your offensive and defensive capabilities at the same time.
Throwing "wave after wave" of anything eventually overwhelms a defender.
And then there is the matter that a CIWS/C-RAM would need at least some kind of upgrade to be able to engage (small, slow) drones: https://www.quora.com/Why-cant-we-rely-on-the-Phalanx-CIWS-t...
(I have no experience at all with these besides seeing some probably-fake Youtube videos supposed to show these shoot down mortar sheels)