No way for toolchain to modify CFLAGS set by the platform
One way to use toolchain (possibly incorrect) is to configure compilation consistently across multiple projects. For this usecase there seem to be no way to alter flags set by the platform files.
Platform files set _INIT
vars which are then use to initialize (but not update) corresponding non-init variables. Because toolchain is included very early, before any platform files, it has no way to update variables set by the platform files.
Take /Zi
in debug builds on Windows MSVC. It is set by the platform file in CMAKE_CXX_FLAGS_DEBUG_INIT
string, if toolchain wants to use /Z7
instead, leaving the rest of the flags as is it can't do it.
If there was a way for toolchain to define post process function and then cmake were to call it just before return from project()
, it could fixup values defined by the platform.