Skip to content

Commit 34bfc12

Browse files
committed
Set sysroot as per ziglang/zig#10158 (comment).
1 parent c323d13 commit 34bfc12

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

helpers/cc.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ export ZIG_LOCAL_CACHE_DIR="$PROJECT_ROOT/.zigcache/"
88

99
set -x
1010

11-
zig cc -target "$ZTARGET" "$@"
11+
if [[ "$ZTARGET" == "macos-*" ]]; then
12+
SYSROOT="$(xcrun --show-sdk-path)"
13+
zig cc -target "$ZTARGET" --sysroot "$SYSROOT" "$@"
14+
else
15+
zig cc -target "$ZTARGET" "$@"
16+
fi
1217

1318
set +x

helpers/cxx.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ export ZIG_LOCAL_CACHE_DIR="$PROJECT_ROOT/.zigcache/"
88

99
set -x
1010

11-
zig c++ -target "$ZTARGET" "$@"
11+
if [[ "$ZTARGET" == "macos-*" ]]; then
12+
SYSROOT="$(xcrun --show-sdk-path)"
13+
zig c++ -target "$ZTARGET" --sysroot "$SYSROOT" "$@"
14+
else
15+
zig c++ -target "$ZTARGET" "$@"
16+
fi
1217

13-
set +x
18+
set +x

0 commit comments

Comments
 (0)