Skip to content

Commit

Permalink
Make sure C++20 is used by both test and library.
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaim committed Feb 21, 2024
1 parent 0b43f4f commit f54b728
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ target_include_directories(xparrow INTERFACE
$<BUILD_INTERFACE:${XPARROW_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)

# We do not use non-standard C++
set_target_properties(xparrow PROPERTIES CMAKE_CXX_EXTENSIONS OFF)
target_compile_features(xparrow INTERFACE cxx_std_20)

if (BUILD_TESTS)
Expand Down
5 changes: 5 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

cmake_minimum_required(VERSION 3.8)


if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
project(xtensor-test CXX)

Expand All @@ -34,3 +35,7 @@ set(XPARROW_TESTS
set(test_target "test_xparrow_lib")
add_executable(${test_target} ${XPARROW_TESTS})
target_link_libraries(${test_target} PRIVATE xparrow doctest::doctest)

# We do not use non-standard C++
set_target_properties(${test_target} PROPERTIES CMAKE_CXX_EXTENSIONS OFF)
target_compile_features(${test_target} PRIVATE cxx_std_20)

0 comments on commit f54b728

Please sign in to comment.