Skip to content

Commit

Permalink
Enable LTO via cargo profile setting
Browse files Browse the repository at this point in the history
RUSTFLAGS is passed to build.rs scripts
and results in
error: lto can only be run for executables, cdylibs and static library outputs

Upstream issue: <rust-lang/cargo#6375>
  • Loading branch information
link2xt committed Apr 4, 2024
1 parent 1f8cb9c commit 2d303fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/build-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ rustup target add aarch64-apple-ios x86_64-apple-ios --toolchain `cat ../rust-to
# Depending your setup, specify the rustup toolchain explicitly.
#
# --no-sanitize-env prevents removal of IPHONEOS_DEPLOYMENT_TARGET variable.
RUSTFLAGS="-C lto=on -C embed-bitcode=yes" \
CARGO_PROFILE_RELEASE_LTO=true \
RUSTFLAGS="-C embed-bitcode=yes" \
cargo +`cat ../rust-toolchain` lipo --xcode-integ --no-sanitize-env --manifest-path "$DIR/deltachat-core-rust/deltachat-ffi/Cargo.toml" --features jsonrpc

# cargo-lipo drops result in different folder, depending on the config.
Expand Down

0 comments on commit 2d303fb

Please sign in to comment.