Skip to content

Commit 8fb6eb9

Browse files
committed
-isysroot priors to $SDKROOT
1 parent b681164 commit 8fb6eb9

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/lib.rs

-13
Original file line numberDiff line numberDiff line change
@@ -3386,19 +3386,6 @@ impl Build {
33863386
let target = self.get_target()?;
33873387
let host = self.get_host()?;
33883388
if host.contains("apple-darwin") && target.contains("apple-darwin") {
3389-
// If, for example, `cargo` runs during the build of an XCode project, then `SDKROOT` environment variable
3390-
// would represent the current target, and this is the problem for us, if we want to compile something
3391-
// for the host, when host != target.
3392-
// We can not just remove `SDKROOT`, because, again, for example, XCode add to PATH
3393-
// /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
3394-
// and `cc` from this path can not find system include files, like `pthread.h`, if `SDKROOT`
3395-
// is not set
3396-
if let Ok(sdkroot) = env::var("SDKROOT") {
3397-
if !sdkroot.contains("MacOSX") {
3398-
let macos_sdk = self.apple_sdk_root("macosx")?;
3399-
cmd.env("SDKROOT", macos_sdk);
3400-
}
3401-
}
34023389
// Additionally, `IPHONEOS_DEPLOYMENT_TARGET` must not be set when using the Xcode linker at
34033390
// "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld",
34043391
// although this is apparently ignored when using the linker at "/usr/bin/ld".

0 commit comments

Comments
 (0)