File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ if(MDSPAN_ENABLE_EXAMPLES)
148148endif ()
149149
150150if (MDSPAN_ENABLE_BENCHMARKS)
151- if (NOT MDSPAN_CXX_STANDARD STREQUAL "14" AND NOT MDSPAN_CXX_STANDARD STREQUAL "23" )
151+ if ("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES )
152152 add_subdirectory (benchmarks )
153153 else ()
154154 MESSAGE (FATAL_ERROR "Benchmarks are not available in C++14 or C++23 mode. Turn MDSPAN_ENABLE_BENCHMARKS OFF or use C++17 or C++20." )
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ function(mdspan_add_benchmark EXENAME)
77 )
88 # Set flag to build with parenthesis enabled
99 target_compile_definitions (${EXENAME} PRIVATE MDSPAN_USE_PAREN_OPERATOR=1 )
10+ target_compile_features (${EXENAME} PRIVATE cxx_std_17 )
1011endfunction ()
1112
1213if (MDSPAN_USE_SYSTEM_BENCHMARK)
@@ -81,6 +82,7 @@ function(mdspan_add_openmp_benchmark EXENAME)
8182 $<BUILD_INTERFACE :${CMAKE_SOURCE_DIR } /benchmarks >
8283 )
8384 target_compile_definitions (${EXENAME} PRIVATE MDSPAN_USE_PAREN_OPERATOR=1 )
85+ target_compile_features (${EXENAME} PRIVATE cxx_std_17 )
8486 else ()
8587 message (WARNING "Not adding target ${EXENAME} because OpenMP was not found" )
8688 endif ()
Original file line number Diff line number Diff line change @@ -21,8 +21,9 @@ if(NOT MDSPAN_ENABLE_CUDA)
2121 add_compilation_test (ctest_compressed_pair_layout )
2222endif ()
2323add_compilation_test (ctest_constexpr_dereference )
24- if (NOT CMAKE_CXX_STANDARD STREQUAL "14" )
25- add_compilation_test (ctest_constexpr_submdspan )
24+ if ("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES )
25+ add_compilation_test (ctest_constexpr_submdspan )
26+ target_compile_features (ctest_constexpr_submdspan PRIVATE cxx_std_17 )
2627endif ()
2728add_compilation_test (ctest_constexpr_layouts )
2829add_compilation_test (ctest_namespace_std )
You can’t perform that action at this time.
0 commit comments