@@ -28,18 +28,11 @@ sourceCpp <- function(file = "",
28
28
verbose = getOption(" verbose" ),
29
29
dryRun = FALSE ) {
30
30
31
- # use an architecture/version specific subdirectory of the cacheDir
32
- # (since cached dynlibs can now perist across sessions we need to be
33
- # sure to invalidate them when R or Rcpp versions change)
34
- cacheDir <- path.expand(cacheDir )
35
- cacheDir <- normalizePath(cacheDir , winslash = " /" , mustWork = FALSE )
36
- cacheDir <- .sourceCppPlatformCacheDir(cacheDir )
37
-
38
31
# resolve code into a file if necessary. also track the working
39
32
# directory to source the R embedded code chunk within
40
33
if (! missing(code )) {
41
34
rWorkingDir <- getwd()
42
- file <- tempfile(fileext = " .cpp" , tmpdir = cacheDir )
35
+ file <- tempfile(fileext = " .cpp" )
43
36
con <- file(file , open = " w" )
44
37
writeLines(code , con )
45
38
close(con )
@@ -64,6 +57,13 @@ sourceCpp <- function(file = "",
64
57
}
65
58
}
66
59
60
+ # use an architecture/version specific subdirectory of the cacheDir
61
+ # (since cached dynlibs can now perist across sessions we need to be
62
+ # sure to invalidate them when R or Rcpp versions change)
63
+ cacheDir <- path.expand(cacheDir )
64
+ cacheDir <- normalizePath(cacheDir , winslash = " /" , mustWork = FALSE )
65
+ cacheDir <- .sourceCppPlatformCacheDir(cacheDir )
66
+
67
67
# get the context (does code generation as necessary)
68
68
context <- .Call(" sourceCppContext" , PACKAGE = " Rcpp" ,
69
69
file , code , rebuild , cacheDir , .Platform )
0 commit comments