Skip to content

Commit 871ace3

Browse files
committed
support C++20 and C++23 (in r-devel)
1 parent b7f44cf commit 871ace3

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2022-09-20 Dirk Eddelbuettel <[email protected]>
2+
3+
* R/Attributes.R: Support C++20 and C++23 via plugins
4+
15
2022-07-27 Dirk Eddelbuettel <[email protected]>
26

37
* DESCRIPTION (Version, Date): Roll minor version

R/Attributes.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,23 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
543543
list(env = list(PKG_CXXFLAGS ="-std=c++17"))
544544
}
545545

546+
# built-in C++20 plugin for C++20
547+
.plugins[["cpp20"]] <- function() {
548+
if (getRversion() >= "4.2") # with recent R versions, R can decide
549+
list(env = list(USE_CXX20 = "yes"))
550+
else
551+
list(env = list(PKG_CXXFLAGS ="-std=c++20"))
552+
}
553+
554+
# built-in C++23 plugin for C++20
555+
.plugins[["cpp23"]] <- function() {
556+
if (getRversion() >= "4.3") # with recent R versions, R can decide
557+
list(env = list(USE_CXX23 = "yes"))
558+
else
559+
list(env = list(PKG_CXXFLAGS ="-std=c++20"))
560+
}
561+
562+
546563
## built-in C++1z plugin for C++17 standard under development
547564
## note that as of Feb 2017 this is taken to be a moving target
548565
## see https://gcc.gnu.org/projects/cxx-status.html

0 commit comments

Comments
 (0)