Skip to content

Commit 83f6ef8

Browse files
committed
test for and report unavailable package in linkingto (closes #1026)
1 parent fea0fcf commit 83f6ef8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2019-11-20 Dirk Eddelbuettel <[email protected]>
2+
3+
* R/Attributes.R: Test for and report unavailable 'LinkingTo' package
4+
15
2019-11-19 Dirk Eddelbuettel <[email protected]>
26

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

R/Attributes.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,11 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) {
962962
# otherwise check for standard Rcpp::interfaces generated include
963963
else if (!pluginsOnly) {
964964
pkgPath <- find.package(package, NULL, quiet=TRUE)
965+
if (length(pkgPath) == 0) {
966+
stop(paste("Package '", package, "' referenced from ",
967+
"LinkingTo directive is not available.", sep=""),
968+
call. = FALSE)
969+
}
965970
pkgHeader <- paste(package, ".h", sep="")
966971
pkgHeaderPath <- file.path(pkgPath, "include", pkgHeader)
967972
if (file.exists(pkgHeaderPath)) {

0 commit comments

Comments
 (0)