summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CompileFeatures/CMP0128OldSameStandard-build-check.cmake
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2022-01-22 15:29:45 (GMT)
committerRaul Tambre <raul@tambre.ee>2022-01-23 21:10:28 (GMT)
commitee1396e29e98dbd3a4517ce364a534c80bc6fb4a (patch)
tree4733f62457243d208594a854e42ec0f5e1424943 /Tests/RunCMake/CompileFeatures/CMP0128OldSameStandard-build-check.cmake
parentb2c25de8e0e2d53d3ff2ad37ed33d4b8a9bf8b1a (diff)
downloadCMake-ee1396e29e98dbd3a4517ce364a534c80bc6fb4a.zip
CMake-ee1396e29e98dbd3a4517ce364a534c80bc6fb4a.tar.gz
CMake-ee1396e29e98dbd3a4517ce364a534c80bc6fb4a.tar.bz2
CMP0128: Add flag in OLD mode even when standard matches the default
Commit 4a0485be (cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic, 2021-04-29) unintentionally changed the behavior by modifying the code to match a pre-existing comment. The resulting behavior change however matches the intentions of CMP0128, so we simply need to guard it. Fixes #23122.
Diffstat (limited to 'Tests/RunCMake/CompileFeatures/CMP0128OldSameStandard-build-check.cmake')
-rw-r--r--Tests/RunCMake/CompileFeatures/CMP0128OldSameStandard-build-check.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/CompileFeatures/CMP0128OldSameStandard-build-check.cmake b/Tests/RunCMake/CompileFeatures/CMP0128OldSameStandard-build-check.cmake
new file mode 100644
index 0000000..8074b9d
--- /dev/null
+++ b/Tests/RunCMake/CompileFeatures/CMP0128OldSameStandard-build-check.cmake
@@ -0,0 +1,12 @@
+foreach(flag @flags@)
+ string(FIND "${actual_stdout}" "${flag}" position)
+
+ if(NOT position EQUAL -1)
+ set(found TRUE)
+ break()
+ endif()
+endforeach()
+
+if(NOT found)
+ set(RunCMake_TEST_FAILED "No compile flags from \"@flags@\" found for LANG_STANDARD=default.")
+endif()