Fixes to emscripten cmake

This commit is contained in:
Justin Luong 2025-09-07 17:40:08 +10:00 committed by Tim Angus
parent 7af7608f62
commit 6d90d74022
3 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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)

View File

@ -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