summaryrefslogtreecommitdiffstats
path: root/Source/cmStandardLevelResolver.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-01-24 17:37:44 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-01-24 17:37:52 (GMT)
commitd5e3b1ca1e29b9a73cd34ad641ed3c68d00ae573 (patch)
tree1a5ec9ac7dc723c195ea7d6bde26dc3467c20954 /Source/cmStandardLevelResolver.cxx
parent63154cbf4501e11cae281eccbbdf9eceb453dae1 (diff)
parentee1396e29e98dbd3a4517ce364a534c80bc6fb4a (diff)
downloadCMake-d5e3b1ca1e29b9a73cd34ad641ed3c68d00ae573.zip
CMake-d5e3b1ca1e29b9a73cd34ad641ed3c68d00ae573.tar.gz
CMake-d5e3b1ca1e29b9a73cd34ad641ed3c68d00ae573.tar.bz2
Merge topic 'cmp0128_cuda'
ee1396e29e CMP0128: Add flag in OLD mode even when standard matches the default b2c25de8e0 CMP0128: Avoid test code duplication 3a089cd256 CMP0128: Prefix test names with mode e13dd52535 XL: Detect default extensions mode for legacy compiler Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6890
Diffstat (limited to 'Source/cmStandardLevelResolver.cxx')
-rw-r--r--Source/cmStandardLevelResolver.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx
index c027e29..785f356 100644
--- a/Source/cmStandardLevelResolver.cxx
+++ b/Source/cmStandardLevelResolver.cxx
@@ -210,8 +210,9 @@ 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 ||
- (cmp0128 == cmPolicies::NEW && ext != defaultExt)) {
+ if ((cmp0128 != cmPolicies::NEW && stdIt <= defaultStdIt) ||
+ (cmp0128 == cmPolicies::NEW &&
+ (stdIt < defaultStdIt || ext != defaultExt))) {
auto offset = std::distance(cm::cbegin(stds), stdIt);
return cmStrCat("CMAKE_", this->Language, stdsStrings[offset], "_", type,
"_COMPILE_OPTION");