Skip to content

Commit 178fd03

Browse files
authored
Address issues with new Catalyst/M1 simulator targets (#614)
* Fix build for the new M1 aarch64-apple-ios-sim target * allow explicit target versioning for catalyst builds * always use ios13.0 target for catalyst builds
1 parent 05a8062 commit 178fd03

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/lib.rs

+16-2
Original file line numberDiff line numberDiff line change
@@ -1535,9 +1535,8 @@ impl Build {
15351535
if let Some(arch) =
15361536
map_darwin_target_from_rust_to_compiler_architecture(target)
15371537
{
1538-
let ios = if arch == "arm64" { "ios" } else { "ios13.0" };
15391538
cmd.args
1540-
.push(format!("--target={}-apple-{}-macabi", arch, ios).into());
1539+
.push(format!("--target={}-apple-ios13.0-macabi", arch).into());
15411540
}
15421541
} else if target.contains("ios-sim") {
15431542
if let Some(arch) =
@@ -1999,6 +1998,11 @@ impl Build {
19991998
None => false,
20001999
};
20012000

2001+
let is_sim = match target.split('-').nth(3) {
2002+
Some(v) => v == "sim",
2003+
None => false,
2004+
};
2005+
20022006
let arch = if is_catalyst {
20032007
match arch {
20042008
"arm64e" => ArchSpec::Catalyst("arm64e"),
@@ -2011,6 +2015,16 @@ impl Build {
20112015
));
20122016
}
20132017
}
2018+
} else if is_sim {
2019+
match arch {
2020+
"arm64" | "aarch64" => ArchSpec::Simulator("-arch arm64"),
2021+
_ => {
2022+
return Err(Error::new(
2023+
ErrorKind::ArchitectureInvalid,
2024+
"Unknown architecture for iOS simulator target.",
2025+
));
2026+
}
2027+
}
20142028
} else {
20152029
match arch {
20162030
"arm" | "armv7" | "thumbv7" => ArchSpec::Device("armv7"),

0 commit comments

Comments
 (0)