Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# rextendr (development version)

* Sets the release profile to use `lto=true` and `codegen-units=1` to ensure compatible builds with WebR as well as reduce the overall compiled package size <https://github.com/extendr/rextendr/pull/466>.
* Fixes compatibility with WebR by adding `CARGO_PROFILE_DEV_PANIC="abort" CARGO_PROFILE_RELEASE_PANIC="abort"` when targeting `wasm32-unknown-emsacripten` target <https://github.com/extendr/rextendr/pull/461>

# rextendr 0.4.1
Expand Down
11 changes: 9 additions & 2 deletions R/use_extendr.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,15 @@ use_extendr <- function(
edition = edition,
`rust-version` = "1.65"
),
lib = list(`crate-type` = array("staticlib", 1), name = lib_name),
dependencies = list(`extendr-api` = "*")
lib = list(
`crate-type` = array("staticlib", 1),
name = lib_name
),
dependencies = list(`extendr-api` = "*"),
`profile.release` = list(
lto = TRUE,
`codegen-units` = 1L
)
)

use_rextendr_template(
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/_snaps/use_extendr.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@

[dependencies]
extendr-api = '*'

[profile.release]
lto = true
codegen-units = 1

---

Expand Down Expand Up @@ -405,6 +409,10 @@

[dependencies]
extendr-api = '*'

[profile.release]
lto = true
codegen-units = 1

# use_rextendr_template() can overwrite existing files

Expand Down
Loading