Cmake variables are global, which is why we would get crud like /machine:X86 in the list of compiler options for MSVC. Clear out the variable before attempting to enumerate arguments and set them.