refactor: Move Apple SDK names to rustc_codegen_ssa:🔙:apple
This commit is contained in:
@@ -3201,9 +3201,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
|
||||
}
|
||||
|
||||
fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) -> Option<PathBuf> {
|
||||
let arch = &sess.target.arch;
|
||||
let os = &sess.target.os;
|
||||
let llvm_target = &sess.target.llvm_target;
|
||||
if sess.target.vendor != "apple"
|
||||
|| !matches!(os.as_ref(), "ios" | "tvos" | "watchos" | "visionos" | "macos")
|
||||
|| !matches!(flavor, LinkerFlavor::Darwin(..))
|
||||
@@ -3215,31 +3213,9 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) ->
|
||||
return None;
|
||||
}
|
||||
|
||||
let sdk_name = match (arch.as_ref(), os.as_ref()) {
|
||||
("aarch64", "tvos") if llvm_target.ends_with("-simulator") => "appletvsimulator",
|
||||
("aarch64", "tvos") => "appletvos",
|
||||
("x86_64", "tvos") => "appletvsimulator",
|
||||
("arm", "ios") => "iphoneos",
|
||||
("aarch64", "ios") if llvm_target.contains("macabi") => "macosx",
|
||||
("aarch64", "ios") if llvm_target.ends_with("-simulator") => "iphonesimulator",
|
||||
("aarch64", "ios") => "iphoneos",
|
||||
("x86", "ios") => "iphonesimulator",
|
||||
("x86_64", "ios") if llvm_target.contains("macabi") => "macosx",
|
||||
("x86_64", "ios") => "iphonesimulator",
|
||||
("x86_64", "watchos") => "watchsimulator",
|
||||
("arm64_32", "watchos") => "watchos",
|
||||
("aarch64", "watchos") if llvm_target.ends_with("-simulator") => "watchsimulator",
|
||||
("aarch64", "watchos") => "watchos",
|
||||
("aarch64", "visionos") if llvm_target.ends_with("-simulator") => "xrsimulator",
|
||||
("aarch64", "visionos") => "xros",
|
||||
("arm", "watchos") => "watchos",
|
||||
(_, "macos") => "macosx",
|
||||
_ => {
|
||||
sess.dcx().emit_err(errors::UnsupportedArch { arch, os });
|
||||
return None;
|
||||
}
|
||||
};
|
||||
let sdk_root = match get_apple_sdk_root(sdk_name) {
|
||||
let sdk_name = apple::sdk_name(&sess.target).to_lowercase();
|
||||
|
||||
let sdk_root = match get_apple_sdk_root(&sdk_name) {
|
||||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
sess.dcx().emit_err(e);
|
||||
|
||||
Reference in New Issue
Block a user