I need to send a build to a code verification service and they require it be built with certain flags.
I am able to get most with target_compile_options but I cannot set it to “Default” like we do in the IDE which has the effect of removing “/RTC1”
How do I REMOVE options?
Is there a class like Public Private Interface Unset or a target_remove_compiler_options.
Usually you don’t remove them; you should instead not set them in the first place. However, you can go in and work with the backing properties directly (should be COMPILE_OPTIONS).
I did not set them. CMake must set them as default from their project template.
To verify I completely removed the build folder after I changed the optimization.
People have asked for this for years, I see
I can set it to the values, just not none which would be same as setting to Default in IDE.
Oh, the flags? string(REPLACE) on CMAKE_<LANG>_FLAGS_<CONFIG> and friends is the way to go there. CMake doesn’t have an abstraction for all of the flags (yet?), and doing anything about these flags requires a policy to change at this point, so it is slow going.
/RTC1 is just set for the DEBUG configuration, so the easiest way could be to build a RELEASE instead.
Do you need an near production or non-optimized build for that service?