Skip to content

Commit

Permalink
Fix "-arch arm64" flag for aarch64-ios-sim
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Gavin Li committed Dec 1, 2022
1 parent c4f414f commit dfd6acc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2262,7 +2262,12 @@ impl Build {
format!("{}os", sdk_prefix)
}
ArchSpec::Simulator(arch) => {
cmd.args.push(arch.into());
if arch.starts_with('-') {
cmd.args.push(arch.into());
} else {
cmd.args.push("-arch".into());
cmd.args.push(arch.into());
}
cmd.args
.push(format!("-m{}simulator-version-min={}", sim_prefix, min_version).into());
format!("{}simulator", sdk_prefix)
Expand Down

0 comments on commit dfd6acc

Please sign in to comment.