diff options
author | Raul Tambre <raul@tambre.ee> | 2021-11-09 18:34:06 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2021-11-11 19:55:04 (GMT) |
commit | e47dfce75d74de26ac6ee25625a44989312e29c1 (patch) | |
tree | b0e802226f6ac38f6f0e3992719f6807355e6577 /Source | |
parent | 2ad300ebd73c6aca7189a9f8ea8d8ad61e9c3223 (diff) | |
download | CMake-e47dfce75d74de26ac6ee25625a44989312e29c1.zip CMake-e47dfce75d74de26ac6ee25625a44989312e29c1.tar.gz CMake-e47dfce75d74de26ac6ee25625a44989312e29c1.tar.bz2 |
CMP0128: Enable/disable extensions if standard same as default
This was intended to be part of the initial MR (!6177), but accidentally went
missing when debugging nightly failures on less common systems. Noticed during
!6711 review as the comment about this behaviour didn't match the code.
Documentation for CMP0128 is updated to remove a false case and note the two
cases related to this.
Fixes #22224.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmStandardLevelResolver.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx index 957f4ca..61416e0 100644 --- a/Source/cmStandardLevelResolver.cxx +++ b/Source/cmStandardLevelResolver.cxx @@ -206,7 +206,8 @@ struct StandardLevelComputer // If the standard requested is older than the compiler's default or the // extension mode doesn't match then we need to use a flag. - if (stdIt < defaultStdIt) { + if (stdIt < defaultStdIt || + (cmp0128 == cmPolicies::NEW && ext != defaultExt)) { auto offset = std::distance(cm::cbegin(stds), stdIt); return cmStrCat("CMAKE_", this->Language, stdsStrings[offset], "_", type, "_COMPILE_OPTION"); |