Skip to content
  • Brad King's avatar
    Modules: Initialize per-language platform-specific flag variables consistently · ae1d5ef4
    Brad King authored
    The `Platform/<OS>.cmake` modules record platform-specific flag
    variables for the C toolchain.  The `CMake<LANG>Information` modules
    initialize the per-language platform-specific flag variables to defaults
    copied from C.  However, they have diverged over time, and not all
    platform-specific flag variables are initialized correctly for all
    languages.  Factor out the CXX language's instance of this logic into a
    helper macro, and reuse it for all languages for which we previously
    had the platform-specific flag variables at least partially filled out.
    
    Previously the Fortran language's copy of this logic used
    `if(NOT DEFINED <var>)` instead of just `if(NOT <var>)` to allow
    `Platform/<OS>-<COMPILER_ID>-<LANG>` modules to specify empty values for
    some platform-specific flag variables without being overridden.
    Use this approach in the helper macro so it applies to all languages.
    
    Fixes: #25990
    ae1d5ef4