Skip to content

Commit

Permalink
#2595: crash fix (#2599)
Browse files Browse the repository at this point in the history
  • Loading branch information
nesbox authored May 25, 2024
1 parent fa8319d commit 8e3f95a
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions cmake/sdl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ if(BUILD_SDL AND NOT EMSCRIPTEN AND NOT RPI)
set(SDL_STATIC_PIC ON CACHE BOOL "" FORCE)
endif()

set(SDL_SHARED OFF CACHE BOOL "" FORCE)

add_subdirectory(${THIRDPARTY_DIR}/sdl2)

endif()
Expand Down Expand Up @@ -41,7 +39,13 @@ if(BUILD_SDL AND BUILD_PLAYER AND NOT RPI)
target_link_options(player-sdl PRIVATE -static)
endif()

target_link_libraries(player-sdl PRIVATE tic80core SDL2main SDL2-static)
target_link_libraries(player-sdl PRIVATE tic80core SDL2main)

if(BUILD_STATIC)
target_link_libraries(player-sdl PRIVATE SDL2-static)
else()
target_link_libraries(player-sdl PRIVATE SDL2)
endif()
endif()

################################
Expand Down Expand Up @@ -113,7 +117,11 @@ if(ANDROID)
endif()

if(NOT EMSCRIPTEN)
target_link_libraries(sdlgpu SDL2-static)
if(BUILD_STATIC)
target_link_libraries(sdlgpu SDL2-static)
else()
target_link_libraries(sdlgpu SDL2)
endif()
endif()

endif()
Expand Down Expand Up @@ -184,7 +192,11 @@ if(BUILD_SDL)
elseif(RPI)
target_link_libraries(tic80 libSDL2.a bcm_host pthread)
else()
target_link_libraries(tic80 SDL2-static)
if(BUILD_STATIC)
target_link_libraries(tic80 SDL2-static)
else()
target_link_libraries(tic80 SDL2)
endif()
endif()
endif()

Expand Down

0 comments on commit 8e3f95a

Please sign in to comment.