From f6131e5928999e02a7606bc49388c71252a1a38f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaim=20=28Jo=C3=ABl=20Lamotte=29?= <142265+Klaim@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:37:54 +0100 Subject: [PATCH] Make sure C++20 is used by both test and library. --- CMakeLists.txt | 2 ++ test/CMakeLists.txt | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19e29ae2..fdbd9555 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,8 @@ target_include_directories(xparrow INTERFACE $ $) +# 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) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 266f4efa..ecd5cd28 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 3.8) + if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) project(xtensor-test CXX) @@ -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)