From 10a37d6e243a6b10c4612c082f331a760795d9f9 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Thu, 23 Dec 2021 18:36:28 +0700 Subject: [PATCH] more consistent installation of dependencies (#397) * more consistent installation of dependencies * don't download SDL2 libs on MSYS * fix typo --- CMakeLists.txt | 6 +++--- Source/CMakeLists.txt | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88fd6c5d..a1114754 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,7 @@ check_symbol_exists(strsignal "string.h" HAVE_STRSIGNAL) # SDL2. On Windows, we use the official development library. find_package(SDL2 2.0.7) if(NOT SDL2_FOUND) - if(WIN32) + if(WIN32 AND NOT MSYS) message(STATUS "Downloading SDL2 Development Library...") if(MSVC) file(DOWNLOAD @@ -86,7 +86,7 @@ endif() # SDL2_mixer. On Windows, we use the official development library. find_package(SDL2_mixer 2.0.2) if(NOT SDL2_MIXER_FOUND) - if(WIN32) + if(WIN32 AND NOT MSYS) message(STATUS "Downloading SDL2_mixer Development Library...") if(MSVC) file(DOWNLOAD @@ -113,7 +113,7 @@ endif() # SDL2_net. On Windows, we use the official development library. find_package(SDL2_net) if(NOT SDL2_NET_FOUND) - if(WIN32) + if(WIN32 AND NOT MSYS) message(STATUS "Downloading SDL2_net Development Library...") if(MSVC) file(DOWNLOAD diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 42d45ce4..58447ecd 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -180,7 +180,7 @@ target_compile_definitions(woof PRIVATE MINIZ_NO_ARCHIVE_APIS) # Assemble library files. set(WOOF_DLLS "") -if(WIN32 AND NOT MINGW) +if(WIN32 AND NOT MSYS) # SDL2 list(APPEND WOOF_DLLS "${SDL2_DLL_DIR}/SDL2.dll") @@ -214,14 +214,15 @@ else() endif() install(FILES ${WOOF_DLLS} DESTINATION .) -if(MINGW) +# Try get dependencies in MSYS2 environment. +if(MSYS) find_program(DLLTOOL_EXECUTABLE NAMES dlltool dlltool.exe ) find_library(MODPLUG libmodplug) - if (MODPLUG AND DLLTOOL_EXECUTABLE) + if(MODPLUG AND DLLTOOL_EXECUTABLE) execute_process(COMMAND "${DLLTOOL_EXECUTABLE}" -I "${MODPLUG}" OUTPUT_VARIABLE MODPLUG_DLL_NAME @@ -236,7 +237,7 @@ if(MINGW) find_library(FLUIDSYNTH libfluidsynth) - if (FLUIDSYNTH AND DLLTOOL_EXECUTABLE) + if(FLUIDSYNTH AND DLLTOOL_EXECUTABLE) execute_process(COMMAND "${DLLTOOL_EXECUTABLE}" -I "${FLUIDSYNTH}" OUTPUT_VARIABLE FLUIDSYNTH_DLL_NAME @@ -249,10 +250,7 @@ if(MINGW) message(WARNING "Can't find libfluidsynth") endif() - install(CODE - "set(MINGW_PATH \"${SDL2_DLL_DIR}\" \"${SDL2_MIXER_DLL_DIR}\" - \"${SDL2_NET_DLL_DIR}\")" - ) + install(CODE "set(MINGW_PATH \"${SDL2_DLL_DIR}\")") install(CODE [[ file(GET_RUNTIME_DEPENDENCIES