Removing `-O` flag in specific target
We are encountering an issue that a project is failing to build with -Ox
and has to be built with -O0
. This is fine because it is non-critical and used for a test-suite.
Question: How can we remove the default compile flags from CMAKE_<LANG>_COMPILE_FLAGS_<CONFIG>
? We want to support FetchContent
so the config could be arbitrary.
@craig.scott suggested 1 we should edit COMPILE_OPTIONS
/COMPILE_FLAGS
directory/target property, but we have tried to print those for CMake 3.22 but it was empty. Any suggestions on what is wrong there? My assumption was that the genex is not displayed, but we tried to overwrite it, but it did not have any effect.