diff options
| author | Scott Wolchok <swolchok@fb.com> | 2019-07-24 10:28:14 -0700 |
|---|---|---|
| committer | Scott Wolchok <swolchok@fb.com> | 2019-07-24 10:28:14 -0700 |
| commit | 287db19e9a480decb491d39c3c22357a7a68f102 (patch) | |
| tree | c8c98138924f9766d9970b7c90ecd9ade0297051 /src/librustc_target/spec | |
| parent | a4ff823f5d7205a983461063d08902986c11d00d (diff) | |
| download | rust-287db19e9a480decb491d39c3c22357a7a68f102.tar.gz rust-287db19e9a480decb491d39c3c22357a7a68f102.zip | |
Add comment
Diffstat (limited to 'src/librustc_target/spec')
| -rw-r--r-- | src/librustc_target/spec/apple_ios_base.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_target/spec/apple_ios_base.rs b/src/librustc_target/spec/apple_ios_base.rs index d400bc62bfd..f46ad06ba43 100644 --- a/src/librustc_target/spec/apple_ios_base.rs +++ b/src/librustc_target/spec/apple_ios_base.rs @@ -29,6 +29,12 @@ impl Arch { } pub fn get_sdk_root(sdk_name: &str) -> Result<String, String> { + // Following what clang does + // (https://github.com/llvm/llvm-project/blob/ + // 296a80102a9b72c3eda80558fb78a3ed8849b341/clang/lib/Driver/ToolChains/Darwin.cpp#L1661-L1678) + // to allow the SDK path to be set. (For clang, xcrun sets + // SDKROOT; for rustc, the user or build system can set it, or we + // can fall back to checking for xcrun on PATH.) if let Some(sdkroot) = env::var("SDKROOT").ok() { let sdkroot_path = Path::new(&sdkroot); if sdkroot_path.is_absolute() && sdkroot_path != Path::new("/") && sdkroot_path.exists() { |
