Explorar o código

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.
Raul Tambre %!s(int64=3) %!d(string=hai) anos
pai
achega
e1adddc74e
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      Tests/RunCMake/CXXModules/NoCXX20.cmake

+ 4 - 3
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)