We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b65a86 commit ccb5d0aCopy full SHA for ccb5d0a
src/librustc_target/spec/apple_ios_base.rs
@@ -1,3 +1,4 @@
1
+use std::env;
2
use std::io;
3
use std::process::Command;
4
use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions};
@@ -27,6 +28,12 @@ impl Arch {
27
28
}
29
30
pub fn get_sdk_root(sdk_name: &str) -> Result<String, String> {
31
+ if let Some(sdkroot) = env::var("SDKROOT").ok() {
32
+ let sdkroot_path = Path::new(sdkroot);
33
+ if sdkroot_path.is_absolute() && sdkroot_path != Path::new("/") && sdkroot_path.exists() {
34
+ return Ok(sdkroot);
35
+ }
36
37
let res = Command::new("xcrun")
38
.arg("--show-sdk-path")
39
.arg("-sdk")
0 commit comments