diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-02-29 23:20:37 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2025-04-13 18:06:43 +0200 |
commit | 27b759ef6a91c5a54dcb175b3844a0e8d13a7911 (patch) | |
tree | 172e7d419fcf2a04e88e5a4df95d7d87a7bb4ee9 | |
parent | 0d027afe18c51dd0dcf8ac79c5eafb60e2cbcc16 (diff) |
Build: Perform CMake check_cxx_source_compiles checks using the same C++ standard as used in the project
(cherry picked from commit 34308dd6decd7011ba7ff1196db49b961577c608)
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | cmake/macros/ConfigureBaseTargets.cmake | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b34f583906d..40f05c5a4d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ project(TrinityCore) cmake_policy(SET CMP0005 NEW) cmake_policy(SET CMP0043 NEW) # Ignore COMPILE_DEFINITIONS_<Config> properties cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted - prevents intepreting if(SOME_STRING_VARIABLE MATCHES "MSVC") as if(SOME_STRING_VARIABLE MATCHES "1") +cmake_policy(SET CMP0067 NEW) # Honor language standard in try_compile() source-file signature cmake_policy(SET CMP0074 NEW) # find_package() uses <PackageName>_ROOT variables if(POLICY CMP0144) diff --git a/cmake/macros/ConfigureBaseTargets.cmake b/cmake/macros/ConfigureBaseTargets.cmake index 26878eec1ba..b9bcaffd7d2 100644 --- a/cmake/macros/ConfigureBaseTargets.cmake +++ b/cmake/macros/ConfigureBaseTargets.cmake @@ -13,14 +13,11 @@ add_library(trinity-compile-option-interface INTERFACE) # Use -std=c++11 instead of -std=gnu++11 set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD 20) # An interface library to make the target features available to other targets add_library(trinity-feature-interface INTERFACE) -target_compile_features(trinity-feature-interface - INTERFACE - cxx_std_20) - # An interface library to make the warnings level available to other targets # This interface taget is set-up through the platform specific script add_library(trinity-warning-interface INTERFACE) |