From f25ee38287889ec3608962170bb260d265664a08 Mon Sep 17 00:00:00 2001 From: alef Date: Sun, 24 Sep 2023 22:08:43 +0200 Subject: [PATCH 1/4] Resolve more dependencies for the container --- .devcontainer/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 587de717484bf..b578fdc3726a7 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -23,8 +23,9 @@ RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \ # [Optional] Uncomment this section to install additional packages. RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends libsdl2-dev libsdl2-ttf-dev \ - libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev build-essential astyle ccache + && apt-get -y install --no-install-recommends libsdl2-dev libsdl2-ttf-dev libharfbuzz-dev \ + libsdl2-image-dev libjpeg-turbo8-dev libtiff-dev libwebp-dev libzip-dev libzstd-dev \ + libsdl2-mixer-dev libflac-dev libasound2-dev libfreetype6-dev build-essential astyle ccache # [Optional] comment out this section unless you want to compile the Object Creator. Install some QT libraries RUN apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools From e5aca9fa562545ddd0c8179b65a36c0653ff8e52 Mon Sep 17 00:00:00 2001 From: alef Date: Sun, 24 Sep 2023 22:09:08 +0200 Subject: [PATCH 2/4] Use dynamic linking for non-VCPKG configuration --- CMakePresets.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index b60b8d7ccc64f..21dd5e1611802 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -31,8 +31,7 @@ "description": "Target Linux (64-bit) with the GCC development environment.", "generator": "Ninja Multi-Config", "cacheVariables": { - "CMAKE_EXE_LINKER_FLAGS": "-fuse-ld=mold", - "DYNAMIC_LINKING": "False", "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "DYNAMIC_LINKING": "True", "CMAKE_BUILD_TYPE": "RelWithDebInfo", "CURSES": "False", "LOCALIZE": "True", "TILES": "True", "SOUND": "True", "TESTS": "False", "CMAKE_INSTALL_MESSAGE": "NEVER" } From f4f2381ccb2532a762b92010812c1534e4226130 Mon Sep 17 00:00:00 2001 From: alef Date: Sun, 24 Sep 2023 22:09:37 +0200 Subject: [PATCH 3/4] Fix typo for pkg-config --- CMakeModules/Find/FindSDL2_image.cmake | 2 +- CMakeModules/Find/FindSDL2_ttf.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeModules/Find/FindSDL2_image.cmake b/CMakeModules/Find/FindSDL2_image.cmake index 67e80b9f16e39..e85855075482e 100644 --- a/CMakeModules/Find/FindSDL2_image.cmake +++ b/CMakeModules/Find/FindSDL2_image.cmake @@ -96,7 +96,7 @@ set(SDL2IMAGE_FOUND ${SDL2_IMAGE_FOUND}) mark_as_advanced(SDL2_IMAGE_LIBRARY SDL2_IMAGE_INCLUDE_DIR) -if(NOT DYNAMIC_LINKING AND PKGCONFIG_FOUND) +if(NOT DYNAMIC_LINKING AND PKG_CONFIG_FOUND) if (NOT TARGET SDL2_image:SDL2_image-static) add_library(SDL2_image::SDL2_image-static STATIC IMPORTED) set_property(TARGET SDL2_image::SDL2_image-static diff --git a/CMakeModules/Find/FindSDL2_ttf.cmake b/CMakeModules/Find/FindSDL2_ttf.cmake index 789db3b8df0ec..7e9e884073237 100644 --- a/CMakeModules/Find/FindSDL2_ttf.cmake +++ b/CMakeModules/Find/FindSDL2_ttf.cmake @@ -95,7 +95,7 @@ set(SDL2TTF_FOUND ${SDL2_TTF_FOUND}) mark_as_advanced(SDL2_TTF_LIBRARY SDL2_TTF_INCLUDE_DIR) -if (NOT DYNAMIC_LINKING AND PKGCONFIG_FOUND) +if (NOT DYNAMIC_LINKING AND PKG_CONFIG_FOUND) if (NOT TARGET SDL2_ttf::SDL2_ttf-static) add_library(SDL2_ttf::SDL2_ttf-static STATIC IMPORTED) set_property(TARGET SDL2_ttf::SDL2_ttf-static From 33b9dac1157e9ed71ad88bbf3b457afa9aa82e5f Mon Sep 17 00:00:00 2001 From: alef Date: Sun, 24 Sep 2023 22:10:17 +0200 Subject: [PATCH 4/4] Link FLAC libraries for dynamic linking too --- CMakeModules/Find/FindSDL2_mixer.cmake | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/CMakeModules/Find/FindSDL2_mixer.cmake b/CMakeModules/Find/FindSDL2_mixer.cmake index 3042b074c0824..469c7ea4591b7 100644 --- a/CMakeModules/Find/FindSDL2_mixer.cmake +++ b/CMakeModules/Find/FindSDL2_mixer.cmake @@ -96,22 +96,30 @@ set(SDL2MIXER_FOUND ${SDL2_MIXER_FOUND}) mark_as_advanced(SDL2_MIXER_LIBRARY SDL2_MIXER_INCLUDE_DIR) -if(NOT DYNAMIC_LINKING AND PKGCONFIG_FOUND) +if(NOT DYNAMIC_LINKING) if (NOT TARGET SDL2_mixer::SDL2_mixer-static) add_library(SDL2_mixer::SDL2_mixer-static STATIC IMPORTED) set_property(TARGET SDL2_mixer::SDL2_mixer-static PROPERTY IMPORTED_LOCATION ${SDL2_MIXER_LIBRARY} ) endif() - message(STATUS "Searching for SDL_mixer deps libraries --") - pkg_check_modules(FLAC REQUIRED IMPORTED_TARGET flac) - target_link_libraries(SDL2_mixer::SDL2_mixer-static INTERFACE - PkgConfig::FLAC - ) elseif(NOT TARGET SDL2_mixer::SDL2_mixer) add_library(SDL2_mixer::SDL2_mixer STATIC IMPORTED) set_property(TARGET SDL2_mixer::SDL2_mixer PROPERTY IMPORTED_LOCATION ${SDL2_MIXER_LIBRARY} ) +endif() -endif() \ No newline at end of file +if(PKG_CONFIG_FOUND) + message(STATUS "Searching for SDL_mixer deps libraries --") + pkg_check_modules(FLAC REQUIRED IMPORTED_TARGET flac) + if(TARGET SDL2_mixer::SDL2_mixer-static) + target_link_libraries(SDL2_mixer::SDL2_mixer-static INTERFACE + PkgConfig::FLAC + ) + elseif(TARGET SDL2_mixer::SDL2_mixer) + target_link_libraries(SDL2_mixer::SDL2_mixer INTERFACE + PkgConfig::FLAC + ) + endif() +endif()