diff options
| author | Vladimir Michael Eatwell <dimir@fb.com> | 2022-03-23 14:54:58 +0000 |
|---|---|---|
| committer | Vladimir Michael Eatwell <dimir@fb.com> | 2022-06-13 16:08:53 +0100 |
| commit | dc5c61028ab9e0a1985ccc913fcab88b5f50efb6 (patch) | |
| tree | 05fd841ede807eb516607988f0e449206fb07c29 /compiler/rustc_codegen_ssa/src/back | |
| parent | c84594661c1b51feb539b479b58bb551fcf8e19a (diff) | |
| download | rust-dc5c61028ab9e0a1985ccc913fcab88b5f50efb6.tar.gz rust-dc5c61028ab9e0a1985ccc913fcab88b5f50efb6.zip | |
Add Apple WatchOS compile targets
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 1f5e2b76bf0..7986690cce2 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -2602,7 +2602,7 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) { let os = &sess.target.os; let llvm_target = &sess.target.llvm_target; if sess.target.vendor != "apple" - || !matches!(os.as_ref(), "ios" | "tvos") + || !matches!(os.as_ref(), "ios" | "tvos" | "watchos") || flavor != LinkerFlavor::Gcc { return; @@ -2612,11 +2612,16 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) { ("x86_64", "tvos") => "appletvsimulator", ("arm", "ios") => "iphoneos", ("aarch64", "ios") if llvm_target.contains("macabi") => "macosx", - ("aarch64", "ios") if llvm_target.contains("sim") => "iphonesimulator", + ("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", + ("arm", "watchos") => "watchos", _ => { sess.err(&format!("unsupported arch `{}` for os `{}`", arch, os)); return; @@ -2663,6 +2668,11 @@ fn get_apple_sdk_root(sdk_name: &str) -> Result<String, String> { "macosx10.15" if sdkroot.contains("iPhoneOS.platform") || sdkroot.contains("iPhoneSimulator.platform") => {} + "watchos" + if sdkroot.contains("WatchSimulator.platform") + || sdkroot.contains("MacOSX.platform") => {} + "watchsimulator" + if sdkroot.contains("WatchOS.platform") || sdkroot.contains("MacOSX.platform") => {} // Ignore `SDKROOT` if it's not a valid path. _ if !p.is_absolute() || p == Path::new("/") || !p.exists() => {} _ => return Ok(sdkroot), |
