Skip to content

Commit e0353c7

Browse files
authored
Merge pull request #1062 from RcppCore/bugfix/r-cmd-shlib-windows-quote
avoid including empty string in R CMD SHLIB call
2 parents 41e5b63 + 82e151a commit e0353c7

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
* docker/ci-dev/Dockerfile: Also install the 'codetools' package
44

5+
2020-03-31 Kevin Ushey <[email protected]>
6+
7+
* R/Attributes.R: Fix for sourceCpp() on Windows w/R-devel
8+
59
2020-03-24 Dirk Eddelbuettel <[email protected]>
610

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

R/Attributes.R

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,25 @@ sourceCpp <- function(file = "",
127127
file.remove(context$previousDynlibPath)
128128
} # #nocov end
129129

130+
# grab components we need to build command
131+
r <- paste(R.home("bin"), "R", sep = .Platform$file.sep)
132+
lib <- context$dynlibFilename
133+
deps <- context$cppDependencySourcePaths
134+
src <- context$cppSourceFilename
135+
130136
# prepare the command (output if we are in showOutput mode)
131-
cmd <- paste(R.home(component="bin"), .Platform$file.sep, "R ",
132-
"CMD SHLIB ",
133-
ifelse(windowsDebugDLL, "-d ", ""),
134-
"-o ", shQuote(context$dynlibFilename), " ",
135-
ifelse(rebuild, "--preclean ", ""),
136-
ifelse(dryRun, "--dry-run ", ""),
137-
paste(shQuote(context$cppDependencySourcePaths),
138-
collapse = " "), " ",
139-
shQuote(context$cppSourceFilename), " ",
140-
sep="")
137+
args <- c(
138+
r, "CMD", "SHLIB",
139+
if (windowsDebugDLL) "-d",
140+
if (rebuild) "--preclean",
141+
if (dryRun) "--dry-run",
142+
"-o", shQuote(lib),
143+
if (length(deps))
144+
paste(shQuote(deps), collapse = " "),
145+
shQuote(src)
146+
)
147+
148+
cmd <- paste(args, collapse = " ")
141149
if (showOutput)
142150
cat(cmd, "\n") # #nocov
143151

0 commit comments

Comments
 (0)