Skip to content

Commit

Permalink
call compile_dll() after load_code()
Browse files Browse the repository at this point in the history
  • Loading branch information
t-kalinowski committed Dec 17, 2024
1 parent 027d446 commit 2123c6a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions R/load.R
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,6 @@ load_all <- function(path = ".",
compile <- if (isTRUE(recompile)) TRUE else NA
}

if (isTRUE(compile)) {
pkgbuild::clean_dll(path)
pkgbuild::compile_dll(path, quiet = quiet)
} else if (identical(compile, NA)) {
pkgbuild::compile_dll(path, quiet = quiet)
} else if (identical(compile, FALSE)) {
# don't compile
} else {
cli::cli_abort("{.arg compile} must be a logical vector of length 1.")
}

old_methods <- list()
clear_cache()

Expand Down Expand Up @@ -206,6 +195,18 @@ load_all <- function(path = ".",

out$code <- load_code(path, quiet = quiet)
register_s3(path)

if (isTRUE(compile)) {
pkgbuild::clean_dll(path)
pkgbuild::compile_dll(path, quiet = quiet)
} else if (identical(compile, NA)) {
pkgbuild::compile_dll(path, quiet = quiet)
} else if (identical(compile, FALSE)) {
# don't compile
} else {
cli::cli_abort("{.arg compile} must be a logical vector of length 1.")
}

if (identical(compile, FALSE)) {
out$dll <- try_load_dll(path)
} else {
Expand Down

0 comments on commit 2123c6a

Please sign in to comment.