Skip to content

Commit ae8005c

Browse files
committed
Enabled C++20
1 parent e654990 commit ae8005c

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ target_include_directories(xtensor-blas
7777
$<BUILD_INTERFACE:${XTENSOR_BLAS_INCLUDE_DIR}>
7878
$<INSTALL_INTERFACE:include>)
7979

80+
target_compile_features(xtensor-blas INTERFACE cxx_std_20)
81+
8082
OPTION(CXXBLAS_DEBUG "print cxxblas debug information" OFF)
8183
OPTION(XTENSOR_USE_FLENS_BLAS "use FLENS generic implementation instead of cblas" OFF)
8284
# Decide whether to use OpenBLAS or not.
@@ -101,6 +103,8 @@ endif()
101103
OPTION(BUILD_TESTS "xtensor-blas test suite" OFF)
102104
OPTION(BUILD_BENCHMARK "xtensor-blas test suite" OFF)
103105

106+
OPTION(CPP23 "enables C++23 (experimental)" OFF)
107+
104108
if(BUILD_TESTS)
105109
enable_testing()
106110
include_directories(${XTENSOR_BLAS_INCLUDE_DIR})

test/CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
3636

3737
include(set_compiler_flag.cmake)
3838

39-
if(CPP20)
39+
if(CPP23)
4040
# User requested C++20, but compiler might not oblige.
4141
set_compiler_flag(
4242
_cxx_std_flag CXX
43-
"-std=c++20" # this should work with GNU, Intel, PGI
44-
"/std:c++20" # this should work with MSVC
43+
"-std=c++23" # this should work with GNU, Intel, PGI
44+
"/std:c++23" # this should work with MSVC
4545
)
4646
if(_cxx_std_flag)
47-
message(STATUS "Building with C++20")
47+
message(STATUS "Building with C++23")
4848
endif()
4949
else()
5050
set_compiler_flag(
5151
_cxx_std_flag CXX REQUIRED
52-
"-std=c++17" # this should work with GNU, Intel, PGI
53-
"/std:c++17" # this should work with MSVC
52+
"-std=c++20" # this should work with GNU, Intel, PGI
53+
"/std:c++20" # this should work with MSVC
5454
)
55-
message(STATUS "Building with C++17")
55+
message(STATUS "Building with C++20")
5656
endif()
5757

5858
if(NOT _cxx_std_flag)
59-
message(FATAL_ERROR "xtensor-blas needs a C++17-compliant compiler.")
59+
message(FATAL_ERROR "xtensor-blas needs a C++20-compliant compiler.")
6060
endif()
6161

6262
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND NOT WIN32))

0 commit comments

Comments
 (0)