-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_wasm.bat
41 lines (27 loc) · 1022 Bytes
/
build_wasm.bat
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
@echo off
IF NOT EXIST build mkdir build
IF NOT EXIST build mkdir run_tree
pushd build
IF NOT EXIST wasm mkdir wasm
popd
pushd run_tree
set name=bigmode
set compiler_flags=-Os -Wall -Wno-implicit-const-int-float-conversion -Wno-missing-braces -Wno-switch -DPLATFORM_WEB
set compiler_flags=--preload-file assets %compiler_flags%
set compiler_flags=-I. -Iinclude %compiler_flags%
set linker_flags=-L. -L../lib/libraylib.a
if ["%~1"]==["release"] (call :Release) else (call :Debug)
goto :EOF
:Debug
set compiler_flags=--shell-file ../code/shell_debug.html %compiler_flags%
goto :Compile
:Release
set compiler_flags=--shell-file ../code/shell.html %compiler_flags%
goto :Compile
:Compile
call emcc -o %name%.html ../code/game.cpp ../lib/libraylib.a -s USE_GLFW=3 -s ASYNCIFY %compiler_flags%
move "%name%.html" ../build/wasm/index.html"
move "%name%.js" ../build/wasm/%name%.js"
move "%name%.wasm" ../build/wasm/%name%.wasm"
move "%name%.data" ../build/wasm/%name%.data"
popd