| ... | @@ -17,8 +17,6 @@ cd "$HOME" | ... | @@ -17,8 +17,6 @@ cd "$HOME" |
| 17 | wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" | 17 | wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" |
| 18 | tar xf "$CACHE_BASENAME.tar.xz" | 18 | tar xf "$CACHE_BASENAME.tar.xz" |
| 19 | | 19 | |
| 20 | ln -s "$PREFIX/bin/llvm-ar.exe" "$PREFIX/bin/llvm-ranlib.exe" | | |
| 21 | | | |
| 22 | cd "$ZIGDIR" | 20 | cd "$ZIGDIR" |
| 23 | | 21 | |
| 24 | # Make the `zig version` number consistent. | 22 | # Make the `zig version` number consistent. |
| ... | @@ -27,37 +25,12 @@ git config core.abbrev 9 | ... | @@ -27,37 +25,12 @@ git config core.abbrev 9 |
| 27 | git fetch --unshallow || true | 25 | git fetch --unshallow || true |
| 28 | git fetch --tags | 26 | git fetch --tags |
| 29 | | 27 | |
| 30 | export CC="$ZIG cc -fno-sanitize=all -target x86_64-windows-gnu -mcpu=native" | | |
| 31 | export CXX="$ZIG c++ -fno-sanitize=all -target x86_64-windows-gnu -mcpu=native" | | |
| 32 | | | |
| 33 | mkdir build | 28 | mkdir build |
| 34 | cd build | 29 | cd build |
| 35 | cmake .. -DCMAKE_BUILD_TYPE=Release \ | 30 | "$ZIG" build -Dstage1 -Dtarget=x86_64-windows-gnu \ |
| 36 | "-DCMAKE_PREFIX_PATH=$PREFIX" \ | 31 | --search-prefix "$PREFIX" \ |
| 37 | "-DCMAKE_INSTALL_PREFIX=$(pwd)/dist" \ | 32 | --override-lib-dir "$ZIGDIR/lib" \ |
| 38 | -DCMAKE_CROSSCOMPILING=True \ | 33 | --prefix "$(pwd)/dist" |
| 39 | -DCMAKE_SYSTEM_NAME="Windows" \ | | |
| 40 | -DCMAKE_AR="$PREFIX/bin/llvm-ar.exe" \ | | |
| 41 | -DCMAKE_RANLIB="$PREFIX/bin/llvm-ranlib.exe" \ | | |
| 42 | -DZIG_OMIT_STAGE2=ON \ | | |
| 43 | -DZIG_STATIC=ON \ | | |
| 44 | -DZIG_TARGET_TRIPLE="x86_64-windows-gnu" \ | | |
| 45 | -DZIG_TARGET_MCPU="baseline" \ | | |
| 46 | -GNinja | | |
| 47 | | | |
| 48 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | | |
| 49 | # so that installation and testing do not get affected by them. | | |
| 50 | unset CC | | |
| 51 | unset CXX | | |
| 52 | | | |
| 53 | ninja install | | |
| 54 | | | |
| 55 | # Here we rebuild zig but this time using the Zig binary we just now produced to | | |
| 56 | # build zig1.o rather than relying on the one built with stage0. See | | |
| 57 | # https://github.com/ziglang/zig/issues/6830 for more details. | | |
| 58 | cmake .. -DZIG_EXECUTABLE="$(pwd)/dist/bin/zig.exe" -DZIG_TARGET_MCPU="x86_64_v2" | | |
| 59 | ninja install | | |
| 60 | | | |
| 61 | | 34 | |
| 62 | dist/bin/zig.exe build test-behavior -Dskip-non-native | 35 | dist/bin/zig.exe build test-behavior -Dskip-non-native |
| 63 | # Disabled to prevent OOM | 36 | # Disabled to prevent OOM |