Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2595: crash fix #2599

Merged
merged 1 commit into from
May 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading