diff options
author | Raul Tambre <raul@tambre.ee> | 2021-05-29 15:34:18 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2021-09-29 19:28:40 (GMT) |
commit | 4a0485be7f4ab06201c478f5a46111ab1e8e773e (patch) | |
tree | a4a89916f051e70a7fac32fbba0daaefbcc4ac0d /Source/cmPolicies.h | |
parent | 29e2b8517126389b2c4b2f3479c4634a8260bea3 (diff) | |
download | CMake-4a0485be7f4ab06201c478f5a46111ab1e8e773e.zip CMake-4a0485be7f4ab06201c478f5a46111ab1e8e773e.tar.gz CMake-4a0485be7f4ab06201c478f5a46111ab1e8e773e.tar.bz2 |
cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic
The changes are part of CMP0128.
When the standard level is unset:
* Flags are added if extension mode doesn't match the compiler's default.
Previously logic only worked if LANG_EXTENSIONS was ON. Fixes #22224.
* The full flag is used. Previously CMAKE_LANG_EXTENSION_COMPILE_OPTION was
used. This was only supported for IAR.
Otherwise:
* Avoid adding flags if not necessary per the detected compiler defaults.
* Fixed check for when the requested standard is older. It now matches the
nearby comments.
I reworded the fallback comment as its logic was a bit difficult to wrap my
head around.
Diffstat (limited to 'Source/cmPolicies.h')
-rw-r--r-- | Source/cmPolicies.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index a98e6c6..ce04117 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -382,7 +382,10 @@ class cmMakefile; 21, 0, cmPolicies::WARN) \ SELECT(POLICY, CMP0127, \ "cmake_dependent_option() supports full Condition Syntax.", 3, 22, \ - 0, cmPolicies::WARN) + 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0128, \ + "Selection of language standard and extension flags improved.", 3, \ + 22, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ |