-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
rustc
's knowledge of LLVM/Clang target triples (#1252)
* Rename Target -> TargetInfo * Add LLVM target triple to TargetInfo * Remove AppleOs wrapper struct * Simplify SDK name lookup code * Fix passing --target to Clang Use the same LLVM target triple as rustc does * Don't pass `--target` twice on Windows * Simplify LLVM target triple version removal * Appease clippy * Fix naming mistake * Simplify
- Loading branch information
Showing
9 changed files
with
764 additions
and
479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use super::TargetInfo; | ||
|
||
impl TargetInfo { | ||
pub(crate) fn apple_sdk_name(&self) -> &'static str { | ||
match (&*self.os, &*self.abi) { | ||
("macos", "") => "macosx", | ||
("ios", "") => "iphoneos", | ||
("ios", "sim") => "iphonesimulator", | ||
("ios", "macabi") => "macosx", | ||
("tvos", "") => "appletvos", | ||
("tvos", "sim") => "appletvsimulator", | ||
("watchos", "") => "watchos", | ||
("watchos", "sim") => "watchsimulator", | ||
("visionos", "") => "xros", | ||
("visionos", "sim") => "xrsimulator", | ||
(os, _) => panic!("invalid Apple target OS {}", os), | ||
} | ||
} | ||
} |
Oops, something went wrong.