Skip to content

Commit 26befe8

Browse files
committed
add new option windowsDebugDLL
1 parent 43a6d84 commit 26befe8

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
2019-12-14 Dirk Eddelbuettel <[email protected]>
22

3+
* R/Attributes.R (sourceCpp): Support new argument windowsDebugDLL to
4+
create a debug DLL, supported on Windows only
5+
* man/sourceCpp.Rd: Document it
6+
37
* src/date.cpp: A few more #nocov tage
48

59
2019-12-13 Dirk Eddelbuettel <[email protected]>

R/Attributes.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Copyright (C) 2012 - 2018 JJ Allaire, Dirk Eddelbuettel and Romain Francois
2+
# Copyright (C) 2012 - 2019 JJ Allaire, Dirk Eddelbuettel and Romain Francois
33
#
44
# This file is part of Rcpp.
55
#
@@ -27,7 +27,8 @@ sourceCpp <- function(file = "",
2727
cleanupCacheDir = FALSE,
2828
showOutput = verbose,
2929
verbose = getOption("verbose"),
30-
dryRun = FALSE) {
30+
dryRun = FALSE,
31+
windowsDebugDLL = FALSE) {
3132

3233
# use an architecture/version specific subdirectory of the cacheDir
3334
# (since cached dynlibs can now perist across sessions we need to be
@@ -63,6 +64,11 @@ sourceCpp <- function(file = "",
6364
stop("The filename '", basename(file), "' contains spaces. This ",
6465
"is not permitted.")
6566
} # #nocov end
67+
} else {
68+
if (verbose && windowsDebugDLL) {
69+
message("The 'windowsDebugDLL' toggle is ignored on non-Windows platforms.")
70+
windowsDebugDLL <- FALSE # no we do not need to for OS below
71+
}
6672
}
6773

6874
# get the context (does code generation as necessary)
@@ -121,6 +127,7 @@ sourceCpp <- function(file = "",
121127
# prepare the command (output if we are in showOutput mode)
122128
cmd <- paste(R.home(component="bin"), .Platform$file.sep, "R ",
123129
"CMD SHLIB ",
130+
ifelse(windowsDebugDLL, "-d ", ""),
124131
"-o ", shQuote(context$dynlibFilename), " ",
125132
ifelse(rebuild, "--preclean ", ""),
126133
ifelse(dryRun, "--dry-run ", ""),

man/sourceCpp.Rd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ and RCPP_MODULE declarations. A shared library is then built and its exported fu
1010
\usage{
1111
sourceCpp(file = "", code = NULL, env = globalenv(), embeddedR = TRUE, rebuild = FALSE,
1212
cacheDir = getOption("rcpp.cache.dir", tempdir()), cleanupCacheDir = FALSE,
13-
showOutput = verbose, verbose = getOption("verbose"), dryRun = FALSE)
13+
showOutput = verbose, verbose = getOption("verbose"), dryRun = FALSE,
14+
windowsDebugDLL = FALSE)
1415
}
1516
\arguments{
1617
\item{file}{
@@ -43,6 +44,9 @@ sourceCpp(file = "", code = NULL, env = globalenv(), embeddedR = TRUE, rebuild =
4344
\item{dryRun}{
4445
\code{TRUE} to do a dry run (showing commands that would be used rather than
4546
actually executing the commands).
47+
}
48+
\item{windowsDebugDLL}{
49+
\code{TRUE} to create a debug DLL on Windows (and ignored on other platforms).
4650
}
4751
}
4852
\details{

0 commit comments

Comments
 (0)