diff --git a/R/compilation-db.R b/R/compilation-db.R index 8102bd15..4ab30233 100644 --- a/R/compilation-db.R +++ b/R/compilation-db.R @@ -58,7 +58,7 @@ has_compilation_db <- function(desc) { out <- as.logical(field) check_bool(out, arg = "Config/build/compilation-database") - + out } @@ -193,15 +193,15 @@ compilers <- function() { # These variables are normally set by frontends but just in case env <- c( "current", - R_INCLUDE_DIR = fs::path(R.home(), "include"), - R_SHARE_DIR = fs::path(R.home(), "share") + R_INCLUDE_DIR = Sys.getenv("R_INCLUDE_DIR", unset = fs::path(R.home(), "include")), + R_SHARE_DIR = Sys.getenv("R_SHARE_DIR", unset = fs::path(R.home(), "share")) ) pkgbuild::with_build_tools( out <- processx::run("make", c(makevars, "print-compilers"), env = env) ) - compilers <- strsplit(out$stdout, "\n")[[1]] + compilers <- strsplit(trimws(out$stdout), "\n")[[1]] # Remove arguments compilers <- strsplit(compilers, " ")