[cmake-developers] XXX_FLAGS_INIT applied inconsistently

Craig Scott craig.scott at crascit.com
Fri Jan 19 07:30:56 EST 2018


I'm looking at the way the various XXX_FLAGS_INIT variables are handled
across the different compilers and platforms. These are set in many files
in the Modules/Compilers, Modules/Platforms and Modules directories. There
seems to be a couple of problems with what I'm seeing:


   - In most cases, the various files are appending rather than prepending
   to the existing contents of the XXX_FLAGS_INIT variables. This means any
   values developers provide cannot override the default ones because later
   flags usually take precedence over earlier ones.
   - Some platforms and compilers (e.g. IRIX, Windows-df, Generic-SDCC-C,
   OSF1, CSharp flags) unilaterally set XXX_FLAGS_INIT variables. This would
   discard any values a developer might set in a toolchain file, for example.

Since I don't know much about the history of all these, I was wondering if
there was any technical reason why the logic works this way? As things
stand, it can be difficult for developers to provide their own
XXX_FLAGS_INIT variables to customise things if they are overridden by the
defaults CMake provides.

-- 
Craig Scott
Melbourne, Australia
https://crascit.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20180119/97b8023c/attachment-0001.html>


More information about the cmake-developers mailing list