In order to produce CO2, the cement has to contain carbon. Where does that carbon come from? Potentially, we could use plants to capture carbon, and put plant matter in the cement. We could also use chemistry and catalysts to skip the plants. It might not be energy efficient, but maybe that doesn't matter. You can use solar panels and run your cement-generation-reactor only during the daytime, as well as put measures in place to cut back on cement usage. This problem is solvable, it just needs creative thinking and an active decision that we are going to solve it.
One of the inputs in cement manufacture is limestone which is Calcium Carbonate. That is ground and heated at high temperatures with clay minerals to produce portland cement.
So CO2 comes from the reaction between limestone and clay. And comes from burning natural gas or coal to generate the heat needed to drive the reaction.
So we use solar instead. We might not even need solar panels, we could potentially use one of those solar thermal reactors with an array of mirrors pointed to a central focal point. They can produce heat up to several hundred degrees C AFAIK.