[cmake-developers] XXX_FLAGS_INIT applied inconsistently

Brad King brad.king at kitware.com
Fri Jan 19 09:15:32 EST 2018


On 01/19/2018 07:30 AM, Craig Scott wrote:
> * In most cases, the various files are appending rather than prepending
> to the existing contents of the XXX_FLAGS_INIT variables.

It was once just setting them.  The `_INIT` variables were not originally
meant to be set by project code or toolchain files at all.  Only recently
did we switch to appending and document them for toolchain files.  The
intended purpose is to accumulate *independent* flags from various sources
of knowledge.

Users can set the `XXX_FLAGS` cache entries directly to override whatever
CMake would initialize them to.  Once they are set the `_INIT` variables
are ignored.

> * 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.

These are leftovers that were never converted to the append approach.
IRIX, OSF1, and Windows-df haven't been used in years AFAIK and could
likely be removed.  Otherwise, see above.

-Brad


More information about the cmake-developers mailing list