Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a debug argument to load_all() #301

Closed
mcol opened this issue Nov 3, 2024 · 1 comment · Fixed by #303
Closed

add a debug argument to load_all() #301

mcol opened this issue Nov 3, 2024 · 1 comment · Fixed by #303

Comments

@mcol
Copy link
Contributor

mcol commented Nov 3, 2024

I've spent quite some time trying to understand why, when compiling some C++ code with devtools::load_all(), I would always get the g -O0 flags (among others) at the very end, thus overriding my preferred settings in ~/.R/Makevars or src/Makevars. Eventually I've worked out that these are appended by pkgbuild::compile_dll(), which is called by pkgload::load_all().

I think the current default makes sense, but it would be nice if pkgload::load_all() had a debug flag that gets passed to pkgbuild::compile_dll(), so that the debug options could be disabled easily. Alternatively, load_all() could accept a ... argument and pass that to compile_dll() (this seems to me an inferior solution though).

@gaborcsardi
Copy link
Member

FWIW you can also set the pkg.build_extra_flags option or the PKG_BUILD_EXTRA_FLAGS env var for pkgbuild, see https://github.com/r-lib/pkgbuild#options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants