mcpe/build-wasm.bat
Brent 5ac3aa6d9e
macOS Support & AppPlatform Cleanup (#57)
* macOS Support & Cleanup

* Fix malformed comments in build-wasm.bat

* Emscripten Fixes

* * Add shebang to the grabsounds.py script

Since it was changed from rw- to rwx, I'll add the shebang so that it actually runs properly.

* * Re-add the patch_data and readme files.

* * Remove sound data.

* Fix some more things.

* Think it's ready to pull now...

---------

Co-authored-by: BrentDaMage <BrentDaMage@users.noreply.github.com>
Co-authored-by: iProgramInCpp <iprogramincpp@gmail.com>
2023-08-17 11:20:59 +03:00

56 lines
1.3 KiB
Batchfile

@echo off
::set the path where your web server's root is (iProgramInCpp's is at C:\gtcache -- don't ask why)
set WEBSRVROOT=C:\gtcache
::set the emscripten root to your emscripten installation (iProgramInCpp's is at C:\emsdk)
echo * Calling emsdk_env.bat.
set EMSCRIPTEN_ROOT=C:\emsdk
set OLDCD=%cd%
cd /d %EMSCRIPTEN_ROOT%
call emsdk_env.bat
cd %OLDCD%
::working directory
echo * Creating wasm working directory.
md wasm
cd wasm
::create output directory
echo * Creating output directory.
del /s /q dist
md dist
::create build directory
echo * Creating build directory
md build
cd build
::note: Why the hell do I need to pop it into a separate window? When I don't, the batch
::file just stops...
::configure build
echo * Configuring build.
start emcmake cmake -GNinja "$@" ..\..\platforms/sdl
echo * PRESS ANY KEY when emcmake is done.
pause > nul
::build
echo * Starting build.
cmake --build .
echo * PRESS ANY KEY when CMake is done.
pause > nul
::bundle
echo * Copying bundle data over.
copy reminecraftpe.* ..\dist
copy ..\..\platforms\emscripten\wasm_shell.html ..\dist\reminecraftpe.html
copy ..\..\thirdparty\coi-serviceworker\coi-serviceworker.min.js ..\dist
::for me only
echo * Copying to your webserver.
xcopy /E /Y ..\dist\ %WEBSRVROOT%\dist\
::cd back
echo * And we are done!!
cd %OLDCD%