Skip to content

Commit

Permalink
never add -arch on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Aug 19, 2024
1 parent ee05046 commit 5eb7d69
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changes/xcodebuild-remove-arch-arg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cargo-mobile2": patch
---

Do not include the target arch when building and archiving the iOS application.
6 changes: 0 additions & 6 deletions src/apple/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ pub struct Config {
use_legacy_build_system: bool,
plist_pairs: Vec<PListPair>,
enable_bitcode: bool,
use_project_archs: bool,
}

impl Config {
Expand Down Expand Up @@ -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),
})
}

Expand Down Expand Up @@ -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()
}
}
3 changes: 0 additions & 3 deletions src/apple/config/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ pub struct Raw {
pub use_legacy_build_system: Option<bool>,
pub plist_pairs: Option<Vec<PListPair>>,
pub enable_bitcode: Option<bool>,
pub use_project_archs: Option<bool>,
}

impl Raw {
Expand All @@ -150,7 +149,6 @@ impl Raw {
use_legacy_build_system: None,
plist_pairs: None,
enable_bitcode: None,
use_project_archs: None,
})
}

Expand Down Expand Up @@ -233,7 +231,6 @@ impl Raw {
use_legacy_build_system: None,
plist_pairs: None,
enable_bitcode: None,
use_project_archs: None,
})
}
}
12 changes: 6 additions & 6 deletions src/apple/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<OsString> = vec![];
duct::cmd("xcodebuild", args)
Expand Down Expand Up @@ -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<OsString> = vec![];
duct::cmd("xcodebuild", args)
Expand Down
2 changes: 1 addition & 1 deletion src/os/macos/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5eb7d69

Please sign in to comment.