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 13, 2024
1 parent d659e3e commit f6131e5
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 @@ -46,6 +46,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 @@ -33,3 +34,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 f6131e5

Please sign in to comment.