Skip to content

Commit a87893b

Browse files
committed
Use SDKROOT when set.
1 parent 53fb72c commit a87893b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,12 @@ impl Build {
21812181
};
21822182

21832183
self.print(&format!("Detecting {} SDK path for {}", os, sdk));
2184-
let sdk_path = self.apple_sdk_root(sdk.as_str())?;
2184+
let sdk_path = if let Some(sdkroot) = env::var_os("SDKROOT") {
2185+
sdkroot
2186+
} else {
2187+
self.apple_sdk_root(sdk.as_str())?
2188+
};
2189+
21852190
cmd.args.push("-isysroot".into());
21862191
cmd.args.push(sdk_path);
21872192
cmd.args.push("-fembed-bitcode".into());

0 commit comments

Comments
 (0)