Skip to content

Commit

Permalink
better use of source_dir and build_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Apr 1, 2020
1 parent c6894c6 commit 1666f67
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions R-package/src/install.libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if (!use_precompile) {
# Prepare installation steps
cmake_cmd <- "cmake "
build_cmd <- "make _lightgbm"
lib_folder <- file.path(R_PACKAGE_SOURCE, "src", fsep = "/")
lib_folder <- file.path(source_dir, fsep = "/")

if (use_gpu) {
cmake_cmd <- paste0(cmake_cmd, " -DUSE_GPU=ON ")
Expand Down Expand Up @@ -98,7 +98,7 @@ if (!use_precompile) {
} else {
cmake_cmd <- paste0(cmake_cmd, local_vs_def)
build_cmd <- "cmake --build . --target _lightgbm --config Release"
lib_folder <- file.path(R_PACKAGE_SOURCE, "src/Release", fsep = "/")
lib_folder <- file.path(source_dir, "Release", fsep = "/")
}
}
}
Expand All @@ -110,9 +110,7 @@ if (!use_precompile) {
# Makefile. We don't need it here anyway since targets are built serially, so trying
# to remove it with this hack
generated_makefile <- file.path(
R_PACKAGE_SOURCE
, "src"
, "build"
build_dir
, "Makefile"
)
if (file.exists(generated_makefile)) {
Expand Down Expand Up @@ -173,7 +171,7 @@ if (file.exists(src)) {
print(paste0("Found library file: ", src, " to move to ", dest))
file.copy(src, dest, overwrite = TRUE)

symbols_file <- file.path(R_PACKAGE_SOURCE, "src", "symbols.rds")
symbols_file <- file.path(source_dir, "symbols.rds")
if (file.exists(symbols_file)) {
file.copy(symbols_file, dest, overwrite = TRUE)
}
Expand Down

0 comments on commit 1666f67

Please sign in to comment.