Adds feature check for c++26
This commit is contained in:
@@ -1 +1,2 @@
|
||||
include(features/reflection)
|
||||
include(features/reflection)
|
||||
include(features/c++26)
|
||||
16
modules/features/c++26.cmake
Normal file
16
modules/features/c++26.cmake
Normal file
@@ -0,0 +1,16 @@
|
||||
cmake_minimum_required(VERSION 3.26)
|
||||
project(TestCXX)
|
||||
|
||||
# Default to C++23
|
||||
set(STD_VERSION 23)
|
||||
|
||||
# Check if the compiler supports C++26
|
||||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag("-std=c++26" COMPILER_SUPPORTS_CXX26)
|
||||
|
||||
if(COMPILER_SUPPORTS_CXX26)
|
||||
set(STD_VERSION 26)
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT_NAME} main.cpp)
|
||||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${STD_VERSION})
|
||||
@@ -23,7 +23,11 @@ function(ConfigureFGLTarget NAME SRC_DIR INCLUDE_DIR)
|
||||
target_compile_definitions(${NAME} PUBLIC "-DFGL_STRICT_WARNINGS=1")
|
||||
endif ()
|
||||
|
||||
target_compile_features(${NAME} PUBLIC cxx_std_26)
|
||||
if (COMPILER_SUPPORTS_CXX26)
|
||||
target_compile_features(${NAME} PUBLIC cxx_std_26)
|
||||
else ()
|
||||
target_compile_features(${NAME} PUBLIC cxx_std_23)
|
||||
endif ()
|
||||
endfunction()
|
||||
|
||||
function(SplitDebugSymbols NAME)
|
||||
|
||||
Reference in New Issue
Block a user