summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CXXModules/NoCXX20.cmake
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2022-06-25 07:08:44 (GMT)
committerBrad King <brad.king@kitware.com>2022-06-28 13:27:29 (GMT)
commite1adddc74e22f93cc30d3d6043ab03d797ead80c (patch)
tree4b5e601e89db93bf8089723d35dcdb7347d85b9b /Tests/RunCMake/CXXModules/NoCXX20.cmake
parent3f7ebf9354173a71a854ee807810fdc42b577204 (diff)
downloadCMake-e1adddc74e22f93cc30d3d6043ab03d797ead80c.zip
CMake-e1adddc74e22f93cc30d3d6043ab03d797ead80c.tar.gz
CMake-e1adddc74e22f93cc30d3d6043ab03d797ead80c.tar.bz2
RunCMake/CXXModules/NoCXX20: Force older standard
Compile features ensure a compiler is aware of a standard version, but the one actually used may be newer. The test relies on the standard chosen being pre-C++20, so force C++17 explicitly. This was exposed by a nightly bot that has a compiler defaulting to C++23. The test would've broken anyway in a few years once GCC or Clang upped their default.
Diffstat (limited to 'Tests/RunCMake/CXXModules/NoCXX20.cmake')
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX20.cmake7
1 files changed, 4 insertions, 3 deletions
diff --git a/Tests/RunCMake/CXXModules/NoCXX20.cmake b/Tests/RunCMake/CXXModules/NoCXX20.cmake
index d502f7c..b7372e8 100644
--- a/Tests/RunCMake/CXXModules/NoCXX20.cmake
+++ b/Tests/RunCMake/CXXModules/NoCXX20.cmake
@@ -5,6 +5,7 @@ target_sources(nocxx20
PUBLIC
FILE_SET fs TYPE CXX_MODULES FILES
sources/module.cxx)
-target_compile_features(nocxx20
- PRIVATE
- cxx_std_17)
+set_target_properties(nocxx20
+ PROPERTIES
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON)