Skip to content

Commit

Permalink
Set sysroot as per ziglang/zig#10158 (comment).
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskorn committed Jan 5, 2022
1 parent c323d13 commit 34bfc12
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion helpers/cc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ export ZIG_LOCAL_CACHE_DIR="$PROJECT_ROOT/.zigcache/"

set -x

zig cc -target "$ZTARGET" "$@"
if [[ "$ZTARGET" == "macos-*" ]]; then
SYSROOT="$(xcrun --show-sdk-path)"
zig cc -target "$ZTARGET" --sysroot "$SYSROOT" "$@"
else
zig cc -target "$ZTARGET" "$@"
fi

set +x
9 changes: 7 additions & 2 deletions helpers/cxx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ export ZIG_LOCAL_CACHE_DIR="$PROJECT_ROOT/.zigcache/"

set -x

zig c++ -target "$ZTARGET" "$@"
if [[ "$ZTARGET" == "macos-*" ]]; then
SYSROOT="$(xcrun --show-sdk-path)"
zig c++ -target "$ZTARGET" --sysroot "$SYSROOT" "$@"
else
zig c++ -target "$ZTARGET" "$@"
fi

set +x
set +x

0 comments on commit 34bfc12

Please sign in to comment.