Skip to content

Commit 0dcf1bc

Browse files
committed
changes to support building on msvc
- Build zlib with the same cflags as zig, so the runtimes are compatible when built with msvc - Remove -Denable-stage1
1 parent 2b347a3 commit 0dcf1bc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

build.bat

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ FOR /F "tokens=2,3 delims=-" %%i IN ("%TARGET%") DO (
2828
set OUTDIR=out-win
2929
set ROOTDIR=%~dp0
3030
set "ROOTDIR_CMAKE=%ROOTDIR:\=/%"
31-
set ZIG_VERSION=0.11.0-dev.78+28288dcbb
31+
set ZIG_VERSION=0.11.0-dev.971+19056cb68
3232

3333
set JOBS_ARG=
3434

@@ -41,7 +41,8 @@ cmake "%ROOTDIR%/zlib" ^
4141
-G "Ninja" ^
4242
-DCMAKE_INSTALL_PREFIX="%ROOTDIR%/%OUTDIR%/host" ^
4343
-DCMAKE_PREFIX_PATH="%ROOTDIR%/%OUTDIR%/host" ^
44-
-DCMAKE_BUILD_TYPE=Release
44+
-DCMAKE_BUILD_TYPE=Release ^
45+
-DCMAKE_USER_MAKE_RULES_OVERRIDE="%ROOTDIR%/zig/cmake/c_flag_overrides.cmake"
4546
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
4647

4748
cmake --build . %JOBS_ARG% --target install
@@ -85,8 +86,8 @@ cmake "%ROOTDIR%/zig" ^
8586
-DZIG_ENABLE_ZSTD=OFF ^
8687
-DZIG_ENABLE_LIBCPP=OFF ^
8788
-DZIG_TARGET_TRIPLE=x86_64-windows-msvc ^
88-
-DZIG_TARGET_MCPU=baseline ^
89-
-DZIG_VERSION="%ZIG_VERSION%"
89+
-DZIG_TARGET_MCPU=baseline
90+
9091
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
9192
cmake --build . %JOBS_ARG% --target install
9293
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
@@ -241,8 +242,7 @@ cd "%ROOTDIR%\zig"
241242
-Dstrip ^
242243
-Dtarget="%TARGET%" ^
243244
-Dcpu="%MCPU%" ^
244-
-Dversion-string="%ZIG_VERSION%" ^
245-
-Denable-stage1
245+
-Dversion-string="%ZIG_VERSION%"
246246
if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL%
247247

248248
popd

0 commit comments

Comments
 (0)