Prechádzať zdrojové kódy

build_system: make ENTT_CXX_STD a cached string variable (not used yet, see #751)

Michele Caini 4 rokov pred
rodič
commit
d63f9e1eff
2 zmenil súbory, kde vykonal 2 pridanie a 0 odobranie
  1. 1 0
      CMakeLists.txt
  2. 1 0
      test/CMakeLists.txt

+ 1 - 0
CMakeLists.txt

@@ -175,6 +175,7 @@ if(ENTT_BUILD_TESTING)
     option(ENTT_BUILD_SNAPSHOT "Build snapshot test with Cereal." OFF)
 
     set(ENTT_ID_TYPE std::uint32_t CACHE STRING "Type of identifiers to use for the tests")
+    set(ENTT_CXX_STD cxx_std_17 CACHE STRING "C++ standard revision to use for the tests")
 
     include(CTest)
     enable_testing()

+ 1 - 0
test/CMakeLists.txt

@@ -38,6 +38,7 @@ add_compile_options($<TARGET_PROPERTY:EnTT,INTERFACE_COMPILE_OPTIONS>)
 
 function(SETUP_TARGET TARGET_NAME)
     set_target_properties(${TARGET_NAME} PROPERTIES CXX_EXTENSIONS OFF)
+    target_compile_features(${TARGET_NAME} PRIVATE ${ENTT_CXX_STD})
     target_link_libraries(${TARGET_NAME} PRIVATE EnTT)
 
     if(MSVC)