eco2d/win/web.bat

22 lines
650 B
Batchfile
Raw Normal View History

2023-01-23 00:12:17 +00:00
rem set up VS (to get ninja generator)
call setup_cl_generic.bat amd64
2022-10-17 09:06:42 +00:00
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
2023-01-22 23:58:07 +00:00
rem start "" python3 -m http.server --bind 127.0.0.1 8000 --directory build_web
2022-10-17 09:06:42 +00:00
pushd ..
2023-01-22 23:58:07 +00:00
call emcmake cmake -S . -B build_web -DCMAKE_BUILD_TYPE=Release -DPLATFORM=Web
call cmake --build build_web --parallel
2022-10-17 09:06:42 +00:00
move build_web\eco2d.html build_web\index.html
popd