From 751cc687bba91b3c348d6bd9195637979ce97cd7 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Sun, 9 May 2021 01:36:17 -0400 Subject: [PATCH 1/2] externals: Update SDL to 107db2d8 In light of 72a49c2bbcce46c24b6d8ee0592989a507dcd68a, the SDL submodule also needs updated. Updates to the same commit used by the SDL package in ext-windows-bin. --- CMakeLists.txt | 4 ++-- externals/SDL | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 054be094d6..c8e9ebf8a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,7 +292,7 @@ if (ENABLE_SDL2) target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") else() - find_package(SDL2 2.0.14 QUIET) + find_package(SDL2 2.0.15 QUIET) if (SDL2_FOUND) # Some installations don't set SDL2_LIBRARIES @@ -305,7 +305,7 @@ if (ENABLE_SDL2) add_library(SDL2 INTERFACE) target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") else() - message(STATUS "SDL2 2.0.14 or newer not found, falling back to externals.") + message(STATUS "SDL2 2.0.15 or newer not found, falling back to externals.") endif() endif() endif() diff --git a/externals/SDL b/externals/SDL index 4cd981609b..107db2d899 160000 --- a/externals/SDL +++ b/externals/SDL @@ -1 +1 @@ -Subproject commit 4cd981609b50ed273d80c635c1ca4c1e5518fb21 +Subproject commit 107db2d89953ee7cc03417d43da1f26bd03aad57 From b021e09fc097d2669c9e80bb3198977c725bc646 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Sun, 9 May 2021 02:38:46 -0400 Subject: [PATCH 2/2] externals: Use SDL2 statically Building it as a shared library causes issues distributing it to an AppImage, since linuxdeploy expects the executable to only dynamically link to system libraries. Additionally, simply dynamically linking to a library in the binary directory is bound to cause issues. Solution is to use SDL's CMake switches and build it statically. We also alias `SDL2` to `SDL2-static` on the external submodule for compatibility with the rest of the project. --- externals/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index e044d9730c..e280e53d71 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -47,7 +47,10 @@ target_include_directories(unicorn-headers INTERFACE ./unicorn/include) # SDL2 if (NOT SDL2_FOUND AND ENABLE_SDL2) + set(SDL_STATIC ON) + set(SDL_SHARED OFF) add_subdirectory(SDL EXCLUDE_FROM_ALL) + add_library(SDL2 ALIAS SDL2-static) endif() # SoundTouch