From b88e22a5fe4e2e4376d6cad64d1e74d104ca8927 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Fri, 20 Sep 2024 12:31:51 +0200 Subject: [PATCH] fix(cli): set ios deployment target only when building for ios (#11063) --- .changes/fix-conditional-ios-deployment-target.md | 6 ++++++ crates/tauri-cli/src/interface/rust.rs | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .changes/fix-conditional-ios-deployment-target.md diff --git a/.changes/fix-conditional-ios-deployment-target.md b/.changes/fix-conditional-ios-deployment-target.md new file mode 100644 index 000000000..2e6de5c10 --- /dev/null +++ b/.changes/fix-conditional-ios-deployment-target.md @@ -0,0 +1,6 @@ +--- +'tauri-cli': 'patch:bug' +'@tauri-apps/cli': 'patch:bug' +--- + +The cli now only sets the iOS deployment target environment variable when building for iOS. diff --git a/crates/tauri-cli/src/interface/rust.rs b/crates/tauri-cli/src/interface/rust.rs index 4e2548481..d2ffc68c7 100644 --- a/crates/tauri-cli/src/interface/rust.rs +++ b/crates/tauri-cli/src/interface/rust.rs @@ -151,10 +151,14 @@ impl Interface for Rust { std::env::set_var("MACOSX_DEPLOYMENT_TARGET", minimum_system_version); } - std::env::set_var( - "IPHONEOS_DEPLOYMENT_TARGET", - &config.bundle.ios.minimum_system_version, - ); + if let Some(target) = &target { + if target.ends_with("ios") || target.ends_with("ios-sim") { + std::env::set_var( + "IPHONEOS_DEPLOYMENT_TARGET", + &config.bundle.ios.minimum_system_version, + ); + } + } let app_settings = RustAppSettings::new(config, manifest, target)?;