Skip to content

Commit aaab6ca

Browse files
committed
Replace CMAKE_CXX_STANDARD override with target_compile_features
1 parent 2d50207 commit aaab6ca

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
set(CMAKE_CXX_STANDARD 11)
2-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3-
set(CMAKE_CXX_EXTENSIONS OFF)
4-
51
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
62
# warning level 4
73
add_compile_options(/W4)
@@ -21,11 +17,13 @@ endif()
2117

2218
set(PREFIX "boost_sort_")
2319
set(LINK_LIBRARIES Boost::sort Boost::included_test_exec_monitor)
20+
set(COMPILE_FEATURES cxx_std_11)
2421

2522
function(boost_sort_add_test name source)
2623
set(pname "${PREFIX}${name}")
2724
add_executable(${pname} ${source})
28-
target_link_libraries(${pname} ${LINK_LIBRARIES})
25+
target_link_libraries(${pname} PRIVATE ${LINK_LIBRARIES})
26+
target_compile_features(${pname} PRIVATE ${COMPILE_FEATURES})
2927
add_test(NAME ${pname} COMMAND ${pname})
3028
add_dependencies(tests ${pname})
3129
endfunction()

0 commit comments

Comments
 (0)