Skip to content

Commit 3304aa5

Browse files
committed
Enabled C++20
1 parent f90b94d commit 3304aa5

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.
@@ -104,6 +106,8 @@ OPTION(BUILD_BENCHMARK "xtensor-blas test suite" OFF)
104106
OPTION(DOWNLOAD_GTEST "download gtest and build from source" OFF)
105107
OPTION(DOWNLOAD_GBENCHMARK "download google benchmark and build from source" OFF)
106108

109+
OPTION(CPP23 "enables C++23 (experimental)" OFF)
110+
107111
if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
108112
set(BUILD_TESTS ON)
109113
endif()

test/CMakeLists.txt

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

3434
include(set_compiler_flag.cmake)
3535

36-
if(CPP20)
36+
if(CPP23)
3737
# User requested C++20, but compiler might not oblige.
3838
set_compiler_flag(
3939
_cxx_std_flag CXX
40-
"-std=c++20" # this should work with GNU, Intel, PGI
41-
"/std:c++20" # this should work with MSVC
40+
"-std=c++23" # this should work with GNU, Intel, PGI
41+
"/std:c++23" # this should work with MSVC
4242
)
4343
if(_cxx_std_flag)
44-
message(STATUS "Building with C++20")
44+
message(STATUS "Building with C++23")
4545
endif()
4646
else()
4747
set_compiler_flag(
4848
_cxx_std_flag CXX REQUIRED
49-
"-std=c++17" # this should work with GNU, Intel, PGI
50-
"/std:c++17" # this should work with MSVC
49+
"-std=c++20" # this should work with GNU, Intel, PGI
50+
"/std:c++20" # this should work with MSVC
5151
)
52-
message(STATUS "Building with C++17")
52+
message(STATUS "Building with C++20")
5353
endif()
5454

5555
if(NOT _cxx_std_flag)
56-
message(FATAL_ERROR "xtensor-blas needs a C++17-compliant compiler.")
56+
message(FATAL_ERROR "xtensor-blas needs a C++20-compliant compiler.")
5757
endif()
5858

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

0 commit comments

Comments
 (0)