Skip to content

Commit 27d3c0c

Browse files
committed
upgraded to C++20
1 parent 2d89b62 commit 27d3c0c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.github/workflows/linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
if [[ "${{matrix.sys.compiler}}" = "gcc" ]]; then export CC=gcc-${{matrix.sys.version}}; export CXX=g++-${{matrix.sys.version}}; else export CC=clang; export CXX=clang++; fi
9797
mkdir ~/.R
9898
touch ~/.R/Makevars
99-
echo "CXX17=$CXX" >> ~/.R/Makevars
100-
echo "CXX17FLAGS=-fPIC -O2" >> ~/.R/Makevars
99+
echo "CXX20=$CXX" >> ~/.R/Makevars
100+
echo "CXX20FLAGS=-fPIC -O2" >> ~/.R/Makevars
101101
Rscript ./unittest.R
102102

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ add_library(xtensor-r INTERFACE)
5757
target_include_directories(xtensor-r INTERFACE $<BUILD_INTERFACE:${XTENSOR_R_INCLUDE_DIR}>
5858
$<INSTALL_INTERFACE:include>)
5959

60-
target_compile_features(xtensor-r INTERFACE cxx_std_17)
60+
target_compile_features(xtensor-r INTERFACE cxx_std_20)
6161

6262
target_link_libraries(xtensor-r INTERFACE xtensor)
6363
get_target_property(inc_dir xtensor-r INTERFACE_INCLUDE_DIRECTORIES)

test/CMakeLists.txt

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

3434
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
3535
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wunused-parameter -Wextra -Wreorder -Wconversion")
36-
CHECK_CXX_COMPILER_FLAG("-std=c++17" HAS_CPP17_FLAG)
36+
CHECK_CXX_COMPILER_FLAG("-std=c++20" HAS_CPP20_FLAG)
3737

38-
if (HAS_CPP17_FLAG)
39-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
38+
if (HAS_CPP20_FLAG)
39+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
4040
else()
41-
message(FATAL_ERROR "Unsupported compiler -- xtensor requires C++17 support!")
41+
message(FATAL_ERROR "Unsupported compiler -- xtensor requires C++20 support!")
4242
endif()
4343
endif()
4444

test/rcpp_tests.cpp

Lines changed: 1 addition & 1 deletion
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-
// [[Rcpp::plugins(cpp17)]]
10+
// [[Rcpp::plugins(cpp20)]]
1111
// [[Rcpp::depends(xtensor)]]
1212

1313
#include "xtensor-r/rcontainer.hpp"

0 commit comments

Comments
 (0)