Skip to content

Commit

Permalink
Enable LTO via cargo profile setting
Browse files Browse the repository at this point in the history
Enabling LTO via RUSTFLAGS results in
error: lto can only be run for executables, cdylibs and static library outputs
  • Loading branch information
link2xt committed Apr 4, 2024
1 parent 5947e2e commit 21d4d08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/build-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ 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 \
CARGO_PROFILE_DEV_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 21d4d08

Please sign in to comment.