Skip to content

Commit 287db19

Browse files
committed
Add comment
1 parent a4ff823 commit 287db19

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc_target/spec/apple_ios_base.rs

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ impl Arch {
2929
}
3030

3131
pub fn get_sdk_root(sdk_name: &str) -> Result<String, String> {
32+
// Following what clang does
33+
// (https://github.com/llvm/llvm-project/blob/
34+
// 296a80102a9b72c3eda80558fb78a3ed8849b341/clang/lib/Driver/ToolChains/Darwin.cpp#L1661-L1678)
35+
// to allow the SDK path to be set. (For clang, xcrun sets
36+
// SDKROOT; for rustc, the user or build system can set it, or we
37+
// can fall back to checking for xcrun on PATH.)
3238
if let Some(sdkroot) = env::var("SDKROOT").ok() {
3339
let sdkroot_path = Path::new(&sdkroot);
3440
if sdkroot_path.is_absolute() && sdkroot_path != Path::new("/") && sdkroot_path.exists() {

0 commit comments

Comments
 (0)