Any idea if it’s okay to use CMAKE_CXX_FLAGS_INIT to provide extra compilation flags when running cmake from command line?
It seems the recommended way to do it is to set CXXFLAGS environment variable, but I wanted to avoid using environment variables as they can be too implicit.
CMAKE_CXX_FLAGS don’t work for this of course, since it’s overriding all compilation flags, not just prepending some new ones.
From my tests CMAKE_CXX_FLAGS_INIT works well for this, but on its doc page there is a notion that it’s meant to be used by the toolchain file. So I was wondering if there are any implications that make _INIT variable undesirable. Or maybe there’s another alternative?