Skip to content

Commit a06980d

Browse files
committed
add rcpp.cache.dir option for global cacheDir setting
1 parent f22dddb commit a06980d

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

R/Attributes.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ sourceCpp <- function(file = "",
2323
env = globalenv(),
2424
embeddedR = TRUE,
2525
rebuild = FALSE,
26-
cacheDir = tempdir(),
26+
cacheDir = getOption("rcpp.cache.dir", tempdir()),
2727
cleanupCacheDir = FALSE,
2828
showOutput = verbose,
2929
verbose = getOption("verbose"),
@@ -238,7 +238,7 @@ cppFunction <- function(code,
238238
includes = character(),
239239
env = parent.frame(),
240240
rebuild = FALSE,
241-
cacheDir = tempdir(),
241+
cacheDir = getOption("rcpp.cache.dir", tempdir()),
242242
showOutput = verbose,
243243
verbose = getOption("verbose")) {
244244

@@ -342,7 +342,7 @@ evalCpp <- function(code,
342342
plugins = character(),
343343
includes = character(),
344344
rebuild = FALSE,
345-
cacheDir = tempdir(),
345+
cacheDir = getOption("rcpp.cache.dir", tempdir()),
346346
showOutput = verbose,
347347
verbose = getOption( "verbose" ) ){
348348

man/cppFunction.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Dynamically define an R function with C++ source code. Compiles and links a shar
88
}
99
\usage{
1010
cppFunction(code, depends = character(), plugins = character(), includes = character(),
11-
env = parent.frame(), rebuild = FALSE, cacheDir = tempdir(),
11+
env = parent.frame(), rebuild = FALSE, cacheDir = getOption("rcpp.cache.dir", tempdir()),
1212
showOutput = verbose, verbose = getOption("verbose"))
1313
}
1414

man/evalCpp.Rd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ Evaluates a C++ expression. This creates a C++ function using
99
\code{\link{cppFunction}} and calls it to get the result.
1010
}
1111
\usage{
12-
evalCpp(code, depends = character(), plugins = character(),
13-
includes = character(), rebuild = FALSE, cacheDir = tempdir(),
12+
evalCpp(code, depends = character(), plugins = character(), includes = character(),
13+
rebuild = FALSE, cacheDir = getOption("rcpp.cache.dir", tempdir()),
1414
showOutput = verbose, verbose = getOption("verbose"))
15+
1516
areMacrosDefined(names, depends = character(), includes = character(),
1617
rebuild = FALSE, showOutput = verbose,
1718
verbose = getOption("verbose"))

man/sourceCpp.Rd

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ Source C++ Code from a File or String
88
and RCPP_MODULE declarations. A shared library is then built and its exported functions and Rcpp modules are made available in the specified environment.
99
}
1010
\usage{
11-
sourceCpp(file = "", code = NULL, env = globalenv(),
12-
embeddedR = TRUE, rebuild = FALSE,
13-
cacheDir = tempdir(), cleanupCacheDir = FALSE,
14-
showOutput = verbose, verbose = getOption("verbose"),
15-
dryRun = FALSE)
11+
sourceCpp(file = "", code = NULL, env = globalenv(), embeddedR = TRUE, rebuild = FALSE,
12+
cacheDir = getOption("rcpp.cache.dir", tempdir()), cleanupCacheDir = FALSE,
13+
showOutput = verbose, verbose = getOption("verbose"), dryRun = FALSE)
1614
}
1715
\arguments{
1816
\item{file}{

0 commit comments

Comments
 (0)