Skip to content

Commit a247c31

Browse files
committed
only provide RCPP_PARALLEL_USE_TBB in inline plugin under windows
1 parent 9d8d9ec commit a247c31

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

R/build.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RcppParallelLibs <- function() {
1717
inlineCxxPlugin <- function() {
1818
list(
1919
env = list(
20-
PKG_CXXFLAGS = "-DRCPP_PARALLEL_USE_TBB=1",
20+
PKG_CXXFLAGS = tbbCxxFlags(),
2121
PKG_LIBS = tbbLdFlags()
2222
),
2323
includes = "#include <RcppParallel.h>",
@@ -27,6 +27,12 @@ inlineCxxPlugin <- function() {
2727
)
2828
}
2929

30+
tbbCxxFlags <- function() {
31+
if (Sys.info()['sysname'] == "Windows")
32+
"-DRCPP_PARALLEL_USE_TBB=1"
33+
else
34+
""
35+
}
3036

3137
# Return the linker flags requried for TBB on this platform
3238
tbbLdFlags <- function() {
@@ -39,7 +45,6 @@ tbbLdFlags <- function() {
3945
}
4046
}
4147

42-
4348
# Determine the platform-specific path to the TBB library
4449
tbbLibPath <- function() {
4550
sysname <- Sys.info()['sysname']

0 commit comments

Comments
 (0)