fix build script for Windows

This commit is contained in:
朱 征赜 2023-08-29 00:52:25 +08:00
parent 071ff334a0
commit c245ae7477
1 changed files with 12 additions and 7 deletions

View File

@ -11,6 +11,18 @@ if not exist build\emsdk (
git clone https://github.com/emscripten-core/emsdk.git build\emsdk
)
rem Check for Ninja binary
pushd build\wasm
if not exist "ninja.exe" (
rem Install Ninja
curl -L https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -o ninja.zip
tar -xzvf ninja.zip
del ninja.zip
)
rem must setup PATH for ninja first to avoid conflict with emsdk_env.bat
set PATH="%PATH%;%cd%"
popd
pushd build\emsdk
rem git pull
call emsdk.bat install 3.0.0
@ -21,13 +33,6 @@ popd
pushd build\wasm
call emcmake cmake -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ..\..
rem Check if Ninja binary exists
if not exist "ninja.exe" (
rem Install Ninja
curl -L https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -o ninja.zip
unzip ninja.zip
del ninja.zip
)
ninja.exe -f build.ninja -j 3
set "TARGET_FILES=KgmLegacy.js KgmWasm.js KgmWasm.wasm KgmWasmBundle.js %CURR_DIR%\LICENSE.txt"