Update: Using C++26 with contracts enabled
This commit is contained in:
@@ -21,7 +21,20 @@ function(course_apply_warnings target_name)
|
||||
endfunction()
|
||||
|
||||
function(course_set_cxx_standard target_name standard)
|
||||
target_compile_features(${target_name} PRIVATE cxx_std_${standard})
|
||||
# Use explicit -std flags so older CLion/CMake builds still get C++26.
|
||||
if(standard GREATER_EQUAL 26)
|
||||
target_compile_options(${target_name} PRIVATE -std=c++26)
|
||||
elseif(standard GREATER_EQUAL 23)
|
||||
target_compile_options(${target_name} PRIVATE -std=c++23)
|
||||
elseif(standard GREATER_EQUAL 20)
|
||||
target_compile_options(${target_name} PRIVATE -std=c++20)
|
||||
elseif(standard GREATER_EQUAL 17)
|
||||
target_compile_options(${target_name} PRIVATE -std=c++17)
|
||||
elseif(standard GREATER_EQUAL 14)
|
||||
target_compile_options(${target_name} PRIVATE -std=c++14)
|
||||
else()
|
||||
target_compile_options(${target_name} PRIVATE -std=c++11)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(course_enable_contracts target_name)
|
||||
|
||||
Reference in New Issue
Block a user