mirror of
https://github.com/ziglang/zig.git
synced 2025-12-13 09:43:09 +00:00
Use zig-bootstrapped x86_64 macos compiler in CI
This commit is contained in:
parent
9c03b39d1e
commit
603242fa86
@ -7,21 +7,21 @@ brew update && brew install s3cmd
|
|||||||
|
|
||||||
ZIGDIR="$(pwd)"
|
ZIGDIR="$(pwd)"
|
||||||
ARCH="x86_64"
|
ARCH="x86_64"
|
||||||
CACHE_BASENAME="zig+llvm+lld+clang-$ARCH-macos-gnu-0.8.0-dev.1939+5a3ea9bec"
|
TARGET="$ARCH-macos-gnu"
|
||||||
|
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.8.0-dev.2168+2d1196773"
|
||||||
PREFIX="$HOME/$CACHE_BASENAME"
|
PREFIX="$HOME/$CACHE_BASENAME"
|
||||||
|
MCPU="baseline"
|
||||||
JOBS="-j2"
|
JOBS="-j2"
|
||||||
|
|
||||||
rm -rf $PREFIX
|
rm -rf $PREFIX
|
||||||
cd $HOME
|
cd $HOME
|
||||||
|
|
||||||
wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"
|
wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"
|
||||||
tar xf "$CACHE_BASENAME.tar.xz"
|
tar xf "$CACHE_BASENAME.tar.xz"
|
||||||
|
|
||||||
ZIG="$PREFIX/bin/zig"
|
ZIG="$PREFIX/bin/zig"
|
||||||
NATIVE_LIBC_TXT="$HOME/native_libc.txt"
|
export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
|
||||||
$ZIG libc >"$NATIVE_LIBC_TXT"
|
export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
|
||||||
export ZIG_LIBC="$NATIVE_LIBC_TXT"
|
|
||||||
export CC="$ZIG cc"
|
|
||||||
export CXX="$ZIG c++"
|
|
||||||
|
|
||||||
cd $ZIGDIR
|
cd $ZIGDIR
|
||||||
|
|
||||||
@ -37,22 +37,21 @@ cmake .. \
|
|||||||
-DCMAKE_INSTALL_PREFIX="$(pwd)/release" \
|
-DCMAKE_INSTALL_PREFIX="$(pwd)/release" \
|
||||||
-DCMAKE_PREFIX_PATH="$PREFIX" \
|
-DCMAKE_PREFIX_PATH="$PREFIX" \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DZIG_TARGET_TRIPLE="$ARCH-native-gnu" \
|
-DZIG_TARGET_TRIPLE="$TARGET" \
|
||||||
-DZIG_TARGET_MCPU="baseline" \
|
-DZIG_TARGET_MCPU="$MCPU" \
|
||||||
-DZIG_STATIC=ON
|
-DZIG_STATIC=ON
|
||||||
|
|
||||||
# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
|
# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
|
||||||
# so that installation and testing do not get affected by them.
|
# so that installation and testing do not get affected by them.
|
||||||
unset CC
|
unset CC
|
||||||
unset CXX
|
unset CXX
|
||||||
unset ZIG_LIBC
|
|
||||||
|
|
||||||
make $JOBS install
|
make $JOBS install
|
||||||
|
|
||||||
# Here we rebuild zig but this time using the Zig binary we just now produced to
|
# Here we rebuild zig but this time using the Zig binary we just now produced to
|
||||||
# build zig1.o rather than relying on the one built with stage0. See
|
# build zig1.o rather than relying on the one built with stage0. See
|
||||||
# https://github.com/ziglang/zig/issues/6830 for more details.
|
# https://github.com/ziglang/zig/issues/6830 for more details.
|
||||||
cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" -DZIG_TARGET_MCPU="x86_64_v2"
|
cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig"
|
||||||
make $JOBS install
|
make $JOBS install
|
||||||
|
|
||||||
for step in test-toolchain test-std docs; do
|
for step in test-toolchain test-std docs; do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user