| ... | ... | @@ -17,8 +17,6 @@ cd "$HOME" |
| 17 | 17 | wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" |
| 18 | 18 | tar xf "$CACHE_BASENAME.tar.xz" |
| 19 | 19 | |
| 20 | | ln -s "$PREFIX/bin/llvm-ar.exe" "$PREFIX/bin/llvm-ranlib.exe" |
| 21 | | |
| 22 | 20 | cd "$ZIGDIR" |
| 23 | 21 | |
| 24 | 22 | # Make the `zig version` number consistent. |
| ... | ... | @@ -27,37 +25,12 @@ git config core.abbrev 9 |
| 27 | 25 | git fetch --unshallow || true |
| 28 | 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 | 28 | mkdir build |
| 34 | 29 | cd build |
| 35 | | cmake .. -DCMAKE_BUILD_TYPE=Release \ |
| 36 | | "-DCMAKE_PREFIX_PATH=$PREFIX" \ |
| 37 | | "-DCMAKE_INSTALL_PREFIX=$(pwd)/dist" \ |
| 38 | | -DCMAKE_CROSSCOMPILING=True \ |
| 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 | | |
| 30 | "$ZIG" build -Dstage1 -Dtarget=x86_64-windows-gnu \ |
| 31 | --search-prefix "$PREFIX" \ |
| 32 | --override-lib-dir "$ZIGDIR/lib" \ |
| 33 | --prefix "$(pwd)/dist" |
| 61 | 34 | |
| 62 | 35 | dist/bin/zig.exe build test-behavior -Dskip-non-native |
| 63 | 36 | # Disabled to prevent OOM |