mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Support Emscripten's SDL2
Emscripten defaults to using SDL 2.0.10, but `export EMCC_LOCAL_PORTS=sdl2=/path/to/SDL2` seems to work.
This commit is contained in:
parent
62cff254b7
commit
a689c3ab96
1 changed files with 4 additions and 0 deletions
|
@ -304,6 +304,10 @@ if(DEFINED SDL2_INCLUDE_DIRS AND DEFINED SDL2_LIBRARIES)
|
|||
message(STATUS "Using pre-defined SDL2 variables SDL2_INCLUDE_DIRS and SDL2_LIBRARIES")
|
||||
target_include_directories(VVVVVV SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL2_INCLUDE_DIRS}>")
|
||||
target_link_libraries(VVVVVV ${SDL2_LIBRARIES})
|
||||
elseif (EMSCRIPTEN)
|
||||
message(STATUS "Using Emscripten SDL2")
|
||||
target_compile_options(VVVVVV PUBLIC -sUSE_SDL=2 -sUSE_SDL_MIXER=2)
|
||||
target_link_libraries(VVVVVV -sUSE_SDL=2 -sUSE_SDL_MIXER=2)
|
||||
else()
|
||||
# Only try to autodetect if both SDL2 variables aren't explicitly set
|
||||
find_package(SDL2 CONFIG)
|
||||
|
|
Loading…
Reference in a new issue