| ... | ... | @@ -7,21 +7,21 @@ brew update && brew install s3cmd |
| 7 | 7 | |
| 8 | 8 | ZIGDIR="$(pwd)" |
| 9 | 9 | ARCH="x86_64" |
| 10 | | CACHE_BASENAME="zig+llvm+lld+clang-$ARCH-macos-gnu-0.8.0-dev.1939+5a3ea9bec" |
| 10 | TARGET="$ARCH-macos-gnu" |
| 11 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.8.0-dev.2168+2d1196773" |
| 11 | 12 | PREFIX="$HOME/$CACHE_BASENAME" |
| 13 | MCPU="baseline" |
| 12 | 14 | JOBS="-j2" |
| 13 | 15 | |
| 14 | 16 | rm -rf $PREFIX |
| 15 | 17 | cd $HOME |
| 18 | |
| 16 | 19 | wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" |
| 17 | 20 | tar xf "$CACHE_BASENAME.tar.xz" |
| 18 | 21 | |
| 19 | 22 | ZIG="$PREFIX/bin/zig" |
| 20 | | NATIVE_LIBC_TXT="$HOME/native_libc.txt" |
| 21 | | $ZIG libc >"$NATIVE_LIBC_TXT" |
| 22 | | export ZIG_LIBC="$NATIVE_LIBC_TXT" |
| 23 | | export CC="$ZIG cc" |
| 24 | | export CXX="$ZIG c++" |
| 23 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" |
| 24 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" |
| 25 | 25 | |
| 26 | 26 | cd $ZIGDIR |
| 27 | 27 | |
| ... | ... | @@ -37,22 +37,21 @@ cmake .. \ |
| 37 | 37 | -DCMAKE_INSTALL_PREFIX="$(pwd)/release" \ |
| 38 | 38 | -DCMAKE_PREFIX_PATH="$PREFIX" \ |
| 39 | 39 | -DCMAKE_BUILD_TYPE=Release \ |
| 40 | | -DZIG_TARGET_TRIPLE="$ARCH-native-gnu" \ |
| 41 | | -DZIG_TARGET_MCPU="baseline" \ |
| 40 | -DZIG_TARGET_TRIPLE="$TARGET" \ |
| 41 | -DZIG_TARGET_MCPU="$MCPU" \ |
| 42 | 42 | -DZIG_STATIC=ON |
| 43 | 43 | |
| 44 | 44 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables |
| 45 | 45 | # so that installation and testing do not get affected by them. |
| 46 | 46 | unset CC |
| 47 | 47 | unset CXX |
| 48 | | unset ZIG_LIBC |
| 49 | 48 | |
| 50 | 49 | make $JOBS install |
| 51 | 50 | |
| 52 | 51 | # Here we rebuild zig but this time using the Zig binary we just now produced to |
| 53 | 52 | # build zig1.o rather than relying on the one built with stage0. See |
| 54 | 53 | # https://github.com/ziglang/zig/issues/6830 for more details. |
| 55 | | cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" -DZIG_TARGET_MCPU="x86_64_v2" |
| 54 | cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" |
| 56 | 55 | make $JOBS install |
| 57 | 56 | |
| 58 | 57 | for step in test-toolchain test-std docs; do |