Skip to content

Commit dfd6acc

Browse files
author
Gavin Li
committed
Fix "-arch arm64" flag for aarch64-ios-sim
Passing "-arch arm64" as a single string to clang causes an "argument unused during compilation" warning that becomes an error if -Werror is enabled. Fix passes it as two separate arguments (unfortunately "-arch=arm64" does not work either).
1 parent c4f414f commit dfd6acc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,12 @@ impl Build {
22622262
format!("{}os", sdk_prefix)
22632263
}
22642264
ArchSpec::Simulator(arch) => {
2265-
cmd.args.push(arch.into());
2265+
if arch.starts_with('-') {
2266+
cmd.args.push(arch.into());
2267+
} else {
2268+
cmd.args.push("-arch".into());
2269+
cmd.args.push(arch.into());
2270+
}
22662271
cmd.args
22672272
.push(format!("-m{}simulator-version-min={}", sim_prefix, min_version).into());
22682273
format!("{}simulator", sdk_prefix)

0 commit comments

Comments
 (0)