diff --git a/Cargo.toml b/Cargo.toml index 046f3496a0f..e0ed90b7339 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -221,6 +221,12 @@ lto = true # Use binary size optimization, since this is intended for distributed copies of the SDK opt-level = "s" +# Profile for the distributed Apple framework. `opt-level = "s"` measured ~33% +# smaller linked code than `release`. +[profile.apple-release] +inherits = "release" +opt-level = "s" + [profile.profiling] inherits = "release" # LTO is too slow to compile. diff --git a/xtask/src/swift.rs b/xtask/src/swift.rs index 3b44ca776b1..c712d6f3d1e 100644 --- a/xtask/src/swift.rs +++ b/xtask/src/swift.rs @@ -91,7 +91,7 @@ impl SwiftArgs { // The dev profile seems to cause crashes on some platforms so we default to // reldbg (https://github.com/matrix-org/matrix-rust-sdk/issues/4009) let profile = - profile.as_deref().unwrap_or(if release { "release" } else { "reldbg" }); + profile.as_deref().unwrap_or(if release { "apple-release" } else { "reldbg" }); build_xcframework( profile, targets,