Skip to content

Commit

Permalink
Merge pull request #205 from albertvaka/albertvaka/emscripten-build-fix
Browse files Browse the repository at this point in the history
Fix build on emscripten
  • Loading branch information
grimfang4 authored Oct 2, 2020
2 parents f15d33c + 3a2b8d2 commit 47a3e2b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ elseif(EMSCRIPTEN)
set(DEFAULT_BUILD_DEMOS OFF)
set(DEFAULT_DISABLE_OPENGL ON)
set(DEFAULT_DISABLE_GLES OFF)
set(DEFAULT_DISABLE_GLES_1 ON)
set(DEFAULT_BUILD_SHARED OFF)
else()
message(" Using generic defaults.")
Expand Down Expand Up @@ -159,7 +160,9 @@ else ()
endif ()

# Find the package for SDL or SDL2
if ( USE_SDL1 )
if ( EMSCRIPTEN )
add_definitions ("-s USE_SDL=2")
elseif ( USE_SDL1 )
find_package(SDL REQUIRED)

if ( NOT SDL_FOUND )
Expand All @@ -168,7 +171,7 @@ if ( USE_SDL1 )

include_directories(${SDL_INCLUDE_DIR})
link_libraries(${SDL_LIBRARY})
else ( USE_SDL1 )
else ( )
find_package(SDL2 REQUIRED)

if ( NOT SDL2_FOUND )
Expand All @@ -182,7 +185,7 @@ else ( USE_SDL1 )

include_directories(${SDL2_INCLUDE_DIR})
link_libraries(${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY})
endif( USE_SDL1 )
endif ()

# Find the package for OpenGL
if (DISABLE_OPENGL)
Expand Down

0 comments on commit 47a3e2b

Please sign in to comment.