add one-shoot web win script

efd/v1
Dominik Madarász 2022-10-17 11:06:42 +02:00
parent 20d35ad653
commit 06f408f09f
1 changed files with 20 additions and 0 deletions

20
win/web.bat 100644
View File

@ -0,0 +1,20 @@
if "%1"=="" MAKE.bat demo_collide.c
rem clone emscripten sdk
if not exist "..\emsdk" (
git clone https://github.com/emscripten-core/emsdk ..\emsdk
pushd ..\emsdk
call emsdk install 3.0.0 && rem latest
call emsdk activate 3.0.0 && rem latest
popd
)
if "%EMSDK%"=="" call ..\emsdk\emsdk_env.bat
rem host webserver, compile and launch
start python -m http.server --bind 127.0.0.1 8000 --directory build_web
pushd ..
emcmake cmake -S . -B build_web -DCMAKE_BUILD_TYPE=Release -DPLATFORM=Web
cmake --build build_web --parallel
move build_web\eco2d.html build_web\index.html
popd