Skip to content

Commit 1382501

Browse files
committed
Switched to c++ 17
1 parent 0a1a4b1 commit 1382501

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ endforeach()
121121
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/modules")
122122

123123
add_library(xtensor-io INTERFACE)
124+
target_compile_features(xtensor-io INTERFACE cxx_std_17)
124125

125126
include_directories(${GTEST_INCLUDE_DIRS})
126127

test/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# The full license is in the file LICENSE, distributed with this software. #
88
############################################################################
99

10-
cmake_minimum_required(VERSION 3.8)
10+
cmake_minimum_required(VERSION 3.30)
1111

1212
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
1313
project(xtensor-io-test)
@@ -25,12 +25,12 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
2525

2626
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
2727
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wunused-parameter -Wextra -Wreorder -Wconversion -Wsign-conversion")
28-
CHECK_CXX_COMPILER_FLAG("-std=c++14" HAS_CPP14_FLAG)
28+
CHECK_CXX_COMPILER_FLAG("-std=c++17" HAS_CPP17_FLAG)
2929

30-
if (HAS_CPP14_FLAG)
31-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
30+
if (HAS_CPP17_FLAG)
31+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
3232
else()
33-
message(FATAL_ERROR "Unsupported compiler -- xtensor requires C++14 support!")
33+
message(FATAL_ERROR "Unsupported compiler -- xtensor requires C++17 support!")
3434
endif()
3535
endif()
3636

0 commit comments

Comments
 (0)