diff --git a/README.md b/README.md index f1d6f732..51809690 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ For Emscripten, setting up the environment with emsdk_env. https://emscripten.org/ 2. `git clone git://github.com/ioquake/ioq3.git` 3. `cd ioq3` - 4. `emcmake -S . -B build -DCMAKE_BUILD_TYPE=Release` + 4. `emcmake cmake -S . -B build -DCMAKE_BUILD_TYPE=Release` 5. `cmake --build build` 3. Copy or symlink your baseq3 pk3 files into the `build/Release/baseq3` directory so they can be loaded at run-time. Only game files listed in diff --git a/cmake/libraries/sdl.cmake b/cmake/libraries/sdl.cmake index 04993833..4cd0b299 100644 --- a/cmake/libraries/sdl.cmake +++ b/cmake/libraries/sdl.cmake @@ -2,6 +2,13 @@ if(NOT BUILD_CLIENT) return() endif() +if(EMSCRIPTEN) + # Emscripten provides its own self contained SDL setup + list(APPEND CLIENT_COMPILE_OPTIONS -sUSE_SDL=2) + list(APPEND CLIENT_LINK_OPTIONS -sUSE_SDL=2) + return() +endif() + set(INTERNAL_SDL_DIR ${SOURCE_DIR}/thirdparty/SDL2-2.32.8) include(utils/arch) diff --git a/cmake/platforms/emscripten.cmake b/cmake/platforms/emscripten.cmake index 03ba18f6..38cbe244 100644 --- a/cmake/platforms/emscripten.cmake +++ b/cmake/platforms/emscripten.cmake @@ -15,8 +15,6 @@ set(USE_OPENAL_DLOPEN OFF CACHE INTERNAL "") set(BUILD_GAME_LIBRARIES OFF CACHE INTERNAL "") set(USE_HTTP OFF CACHE INTERNAL "") -list(APPEND CLIENT_COMPILE_OPTIONS -sUSE_SDL=2) - list(APPEND CLIENT_LINK_OPTIONS -sTOTAL_MEMORY=256MB -sSTACK_SIZE=5MB