From: DeaDDooMER Date: Fri, 3 Apr 2020 17:23:27 +0000 (+0300) Subject: emscripten: fix sdl2 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=9655a639b9fc78018bb93d02edf2f35b216b3fe1;p=flatwaifu.git emscripten: fix sdl2 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d395262..83cd7f2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -57,7 +57,7 @@ if(WITH_SDL) endif() elseif(WITH_SDL2) if(D2D_FOR_EMSCRIPTEN) - set(D2D_SYSTEM_SRC "${D2D_SDL_SRC}") + set(D2D_SYSTEM_SRC "${D2D_SDL2_SRC}") set(D2D_SYSTEM_INCLUDE_DIR "") set(D2D_SYSTEM_LIBRARY "-lSDL2") set(D2D_SYSTEM_LINKFLAGS "-s USE_SDL=2") @@ -118,13 +118,13 @@ elseif(WITH_SDLMIXER) set(D2D_SOUND_SRC "${D2D_SDLMIXER_SRC}") set(D2D_SOUND_INCLUDE_DIR "${SDLMIXER_INCLUDE_DIR}") set(D2D_SOUND_LIBRARY "${SDLMIXER_LIBRARY}") -else(WITH_STUBSOUND) +else() message(FATAL_ERROR "Select SOUND_DRIVER as 'OPENAL' or 'SDLMIXER' or 'STUB'") -endif(WITH_STUBSOUND) +endif() if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) -endif (NOT CMAKE_BUILD_TYPE) +endif() set(CMAKE_C_FLAGS "") set(CMAKE_C_FLAGS_DEBUG "-g -O0 -Wall") set(CMAKE_C_FLAGS_RELEASE "-O3") # -DNDEBUG @@ -145,7 +145,9 @@ if(D2D_FOR_EMSCRIPTEN) set(CMAKE_EXECUTABLE_SUFFIX ".html") configure_file(${D2D_GAME_ROOT}/doom2d.wad doom2d.wad COPYONLY) set(D2D_DOOM2D_WAD doom2d.wad) - set_target_properties(doom2d PROPERTIES LINK_FLAGS "-s WASM=0 -s DISABLE_EXCEPTION_CATCHING=1 -s SAFE_HEAP=1 -s ASSERTIONS=1 -s GL_ASSERTIONS=1 ${D2D_SYSTEM_LINKFLAGS} ${D2D_RENDER_LINKFLAGS} ${D2D_SOUND_LINKFLAGS} --preload-file ${D2D_DOOM2D_WAD}") + configure_file(${D2D_GAME_ROOT}/default.cfg default.cfg COPYONLY) + set(D2D_DEFAULT_CFG default.cfg) + set_target_properties(doom2d PROPERTIES LINK_FLAGS "-s WASM=0 -s DISABLE_EXCEPTION_CATCHING=1 -s SAFE_HEAP=1 -s ASSERTIONS=1 -s GL_ASSERTIONS=1 ${D2D_SYSTEM_LINKFLAGS} ${D2D_RENDER_LINKFLAGS} ${D2D_SOUND_LINKFLAGS} --preload-file ${D2D_DOOM2D_WAD} --preload-file ${D2D_DEFAULT_CFG}") else() target_link_libraries(doom2d "${D2D_SYSTEM_LIBRARY}" "${D2D_RENDER_LIBRARY}" "${D2D_SOUND_LIBRARY}") endif()