-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildWasm.cmd
More file actions
44 lines (35 loc) · 982 Bytes
/
BuildWasm.cmd
File metadata and controls
44 lines (35 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@echo off
setlocal
set "CURR_DIR=%CD%"
set "BUILD_TYPE=%1"
if "%BUILD_TYPE%"=="" set "BUILD_TYPE=Release"
md build\wasm 2>nul
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.12.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 latest
call emsdk.bat activate latest
call emsdk_env.bat
popd
pushd build\wasm
call emcmake cmake -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DBUILD_WASM=ON ..\..
ninja.exe -f build.ninja -j 0
set "TARGET_FILES=TomlLegacy.js TomlWasm.js TomlWasm.wasm TomlWasmBundle.js %CURR_DIR%\LICENSE.txt"
for %%f in (%TARGET_FILES%) do (
copy "%%f" "%CURR_DIR%\node\out"
)
popd
endlocal