Skip to content

Commit

Permalink
Use R.home() to retrieve include and share paths (#297)
Browse files Browse the repository at this point in the history
Fixes #296, follow-up to #287.
  • Loading branch information
shikokuchuo authored Sep 9, 2024
1 parent 3fe8258 commit 96d1a74
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ Config/testthat/parallel: TRUE
Config/testthat/start-first: dll
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# pkgload (development version)

* The generator of `compile_commands.json` now checks for existing `R_SHARE_DIR`
and `R_INCLUDE_DIR` environment variables (#287, @TimTaylor).
and `R_INCLUDE_DIR` environment variables (#287, #296, @TimTaylor and
@shikokuchuo).

* The generator of `compile_commands.json` is now more reliable in the presence
of extra whitespace in `make`'s output (#288, @TimTaylor).
Expand Down
4 changes: 2 additions & 2 deletions R/compilation-db.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ compilers <- function() {
# These variables are normally set by frontends but just in case
env <- c(
"current",
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"))
R_INCLUDE_DIR = R.home("include"),
R_SHARE_DIR = R.home("share")
)

pkgbuild::with_build_tools(
Expand Down

0 comments on commit 96d1a74

Please sign in to comment.