From 8a876af8392c020e0dea8dba38534b615de73d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=20=E5=BE=81=E8=B5=9C?= <959220793@qq.com> Date: Tue, 29 Aug 2023 01:00:03 +0800 Subject: [PATCH] fix build script for Windows --- build-wasm.cmd | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/build-wasm.cmd b/build-wasm.cmd index 0da923d..55082c5 100644 --- a/build-wasm.cmd +++ b/build-wasm.cmd @@ -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=QmcLegacy.js QmcWasm.js QmcWasm.wasm QmcWasmBundle.js %CURR_DIR%\LICENSE.txt"