Skip to content

Commit 92e5d60

Browse files
committed
build: C++23 enabled for test_package when import std is ON
1 parent 23c4244 commit 92e5d60

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test_package/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ message(STATUS "MP_UNITS_BUILD_CXX_MODULES: ${MP_UNITS_BUILD_CXX_MODULES}")
2828
find_package(mp-units REQUIRED)
2929

3030
add_executable(test_package-headers test_package.cpp)
31-
target_compile_features(test_package-headers PRIVATE cxx_std_20)
31+
target_compile_features(test_package-headers PRIVATE $<IF:$<BOOL:${CMAKE_CXX_MODULE_STD}>,cxx_std_23,cxx_std_20>)
3232
target_link_libraries(test_package-headers PRIVATE mp-units::mp-units)
3333

3434
if(MP_UNITS_BUILD_CXX_MODULES)
3535
add_executable(test_package test_package.cpp)
36-
target_compile_features(test_package PRIVATE cxx_std_20)
36+
target_compile_features(test_package PRIVATE $<IF:$<BOOL:${CMAKE_CXX_MODULE_STD}>,cxx_std_23,cxx_std_20>)
37+
# TODO clang complains about missing module
38+
# target_compile_definitions(test_package PRIVATE MP_UNITS_MODULES)
3739
target_link_libraries(test_package PRIVATE mp-units::mp-units)
3840
endif()

0 commit comments

Comments
 (0)