Skip to content

Commit 4180fad

Browse files
committed
Inline plugin: only provide PKG_LIBS on Windows
1 parent e7ee864 commit 4180fad

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

R/build.R

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22

33

44
inlineCxxPlugin <- function() {
5-
tbb <- tbbLibPath()
6-
if (!is.null(tbb)) {
5+
6+
# For sourceCpp on Windows we need to explicitly link against tbb.dll
7+
if (Sys.info()['sysname'] == "Windows") {
8+
tbb <- tbbLibPath()
79
pkgLibs <- paste("-L", asBuildPath(dirname(tbb)),
810
" -ltbb", sep="")
9-
list(
10-
env = list(PKG_LIBS = pkgLibs),
11-
includes = "#include <RcppParallel.h>",
12-
LinkingTo = "RcppParallel",
13-
body = function( x ) x,
14-
Depends = "RcppParallel"
15-
)
11+
env <- list(PKG_LIBS = pkgLibs)
1612
} else {
17-
NULL
13+
env <- list()
1814
}
15+
16+
list(
17+
env = env,
18+
includes = "#include <RcppParallel.h>",
19+
LinkingTo = "RcppParallel",
20+
body = function( x ) x,
21+
Depends = "RcppParallel"
22+
)
1923
}
2024

2125

0 commit comments

Comments
 (0)