# Try audodetecting sysroot when building Darwin on Darwin · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/e9bee08f8869bc97312f37a76cb00b98b8c6ee3d)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: e9bee08f8869bc97312f37a76cb00b98b8c6ee3d

Requested commit: e9bee08f8869bc97312f37a76cb00b98b8c6ee3d

Commit: e9bee08f8869bc97312f37a76cb00b98b8c6ee3d

Tree: b6d4b2e6153740ccb7f0503d13c7613a5a45f30b

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
Try audodetecting sysroot when building Darwin on Darwin

This is now no longer limited to targeting macOS natively but also
tries to detect the sysroot when targeting different Apple platforms
from macOS; for instance targeting iPhone Simulator from macOS. In
this case, Zig will try detecting the SDK path by invoking
`xcrun --sdk iphonesimulator --show-sdk-path`, and if the command
fails because the SDK doesn't exist (case when having CLT installed only)
or not having either Xcode or CLT installed, we simply return null
signaling that the user has to provide the sysroot themselves.

```

## Parents

- [2371a63bd46cb1af7e3b9857136ea7677f6abdcc](https://git.cafe/gitcafe/zig/commit/2371a63bd46cb1af7e3b9857136ea7677f6abdcc?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/e9bee08f8869bc97312f37a76cb00b98b8c6ee3d?format=markdown)
