From 5eb7d6920b7f462e665d2fda79d66800d73f7b80 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Mon, 19 Aug 2024 11:32:40 -0300 Subject: [PATCH] never add -arch on iOS --- .changes/xcodebuild-remove-arch-arg.md | 5 +++++ src/apple/config/mod.rs | 6 ------ src/apple/config/raw.rs | 3 --- src/apple/target.rs | 12 ++++++------ src/os/macos/ffi.rs | 2 +- 5 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 .changes/xcodebuild-remove-arch-arg.md diff --git a/.changes/xcodebuild-remove-arch-arg.md b/.changes/xcodebuild-remove-arch-arg.md new file mode 100644 index 00000000..270b1c77 --- /dev/null +++ b/.changes/xcodebuild-remove-arch-arg.md @@ -0,0 +1,5 @@ +--- +"cargo-mobile2": patch +--- + +Do not include the target arch when building and archiving the iOS application. diff --git a/src/apple/config/mod.rs b/src/apple/config/mod.rs index 0bfc7d3f..8187d231 100644 --- a/src/apple/config/mod.rs +++ b/src/apple/config/mod.rs @@ -290,7 +290,6 @@ pub struct Config { use_legacy_build_system: bool, plist_pairs: Vec, enable_bitcode: bool, - use_project_archs: bool, } impl Config { @@ -363,7 +362,6 @@ impl Config { use_legacy_build_system: raw.use_legacy_build_system.unwrap_or(true), plist_pairs: raw.plist_pairs.unwrap_or_default(), enable_bitcode: raw.enable_bitcode.unwrap_or(false), - use_project_archs: raw.use_project_archs.unwrap_or(false), }) } @@ -429,8 +427,4 @@ impl Config { pub fn bundle_version(&self) -> &VersionNumber { &self.bundle_version } - - pub fn use_project_archs(&self) -> bool { - self.use_project_archs.clone() - } } diff --git a/src/apple/config/raw.rs b/src/apple/config/raw.rs index cfcf00a5..4014d00f 100644 --- a/src/apple/config/raw.rs +++ b/src/apple/config/raw.rs @@ -127,7 +127,6 @@ pub struct Raw { pub use_legacy_build_system: Option, pub plist_pairs: Option>, pub enable_bitcode: Option, - pub use_project_archs: Option, } impl Raw { @@ -150,7 +149,6 @@ impl Raw { use_legacy_build_system: None, plist_pairs: None, enable_bitcode: None, - use_project_archs: None, }) } @@ -233,7 +231,6 @@ impl Raw { use_legacy_build_system: None, plist_pairs: None, enable_bitcode: None, - use_project_archs: None, }) } } diff --git a/src/apple/target.rs b/src/apple/target.rs index 7b335181..03cf9e5a 100644 --- a/src/apple/target.rs +++ b/src/apple/target.rs @@ -321,10 +321,10 @@ impl<'a> Target<'a> { let scheme = config.scheme(); let workspace_path = config.workspace_path(); let sdk = self.sdk.to_string(); - let arch = if config.use_project_archs() { - None - } else { + let arch = if self.is_macos() { Some(self.arch.to_string()) + } else { + None }; let args: Vec = vec![]; duct::cmd("xcodebuild", args) @@ -377,10 +377,10 @@ impl<'a> Target<'a> { let scheme = config.scheme(); let workspace_path = config.workspace_path(); let sdk = self.sdk.to_string(); - let arch = if config.use_project_archs() { - None - } else { + let arch = if self.is_macos() { Some(self.arch.to_string()) + } else { + None }; let args: Vec = vec![]; duct::cmd("xcodebuild", args) diff --git a/src/os/macos/ffi.rs b/src/os/macos/ffi.rs index a7d86763..ca99faed 100644 --- a/src/os/macos/ffi.rs +++ b/src/os/macos/ffi.rs @@ -15,7 +15,7 @@ pub const kLSRolesNone: LSRolesMask = 0x00000001; pub const kLSRolesViewer: LSRolesMask = 0x00000002; pub const kLSRolesEditor: LSRolesMask = 0x00000004; pub const kLSRolesShell: LSRolesMask = 0x00000008; -pub const kLSRolesAll: LSRolesMask = LSRolesMask::max_value(); +pub const kLSRolesAll: LSRolesMask = LSRolesMask::MAX; // https://developer.apple.com/documentation/coreservices/lslaunchflags?language=objc pub type LSLaunchFlags = OptionBits;