From de5eb2066aed684c60175f91dc763c6d9ab588be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20P=C3=A9rez?= <37264926+CPerezz@users.noreply.github.com> Date: Wed, 8 Feb 2023 12:38:42 +0100 Subject: [PATCH] change: Replace profile overwrites to Workspace Cargo.toml (#95) Since profile info specified inside workspace members `Cargo.toml`'s is ignored by Cargo, this replaces the place to specify these details for the workspace-level `Cargo.toml`. NOTE that `panic` and `rpath` aren't supported with the Overwritting feature. Therefore, the only required thing (if considered necessary) is to create a new profile which also enables these things. Resolves: #93 --- Cargo.toml | 13 +++++++++++++ rln-wasm/Cargo.toml | 3 --- semaphore/Cargo.toml | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3f7de4c..f46e5bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,16 @@ members = [ "rln-wasm", "utils", ] + +# Compilation profile for any non-workspace member. +# Dependencies are optimized, even in a dev build. This improves dev performance +# while having neglible impact on incremental build times. +[profile.dev.package."*"] +opt-level = 3 + +[profile.release.package."rln-wasm"] +# Tell `rustc` to optimize for small code size. +opt-level = "s" + +[profile.release.package."semaphore"] +codegen-units = 1 \ No newline at end of file diff --git a/rln-wasm/Cargo.toml b/rln-wasm/Cargo.toml index 4aa6dc3..6b61812 100644 --- a/rln-wasm/Cargo.toml +++ b/rln-wasm/Cargo.toml @@ -31,6 +31,3 @@ console_error_panic_hook = { version = "0.1.7", optional = true } wasm-bindgen-test = "0.3.13" wasm-bindgen-futures = "0.4.33" -[profile.release] -# Tell `rustc` to optimize for small code size. -opt-level = "s" diff --git a/semaphore/Cargo.toml b/semaphore/Cargo.toml index 9f06fed..58104a4 100644 --- a/semaphore/Cargo.toml +++ b/semaphore/Cargo.toml @@ -47,4 +47,4 @@ opt-level = 3 # Dependencies are optimized, even in a dev build. This improves dev performance # while having neglible impact on incremental build times. [profile.dev.package."*"] -opt-level = 3 +opt-level = 3 \ No newline at end of file