From afb6cd827d5bdf9f1e890aefbb44516c926783d4 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Wed, 19 Jun 2024 14:52:30 +0200 Subject: Fixed cURL linker issues on MSYS2 MSYS2 builds cURL 8.8 with CMake, which installs a CURLConfig.cmake file. Since CMake 3.17, the FindCURL module will prefer to return the values from the config file. However, CURLConfig.cmake does not set CURL_LIBRARIES. While a fix for this is pending release (see https://github.com/curl/curl/commit/1dec702c8676fef3a7b5850e5350102876067680), we can rather update to modern CMake by relying on the IMPORTED target CURL::libcurl, which is set since CMake 3.12 (our current minimum required version). --- src/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f993f4ed..9ced2c13 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -75,7 +75,6 @@ include_directories( ${SDL2_INCLUDE_DIRS} ${PNG_INCLUDE_DIR} ${PHYSFS_INCLUDE_DIR} - ${CURL_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR} ${ENET_INCLUDE_DIR} ${GUICHAN_INCLUDE_DIR} @@ -626,7 +625,7 @@ target_link_libraries( ${SDL2_LINK_LIBRARIES} ${PNG_LIBRARIES} ${PHYSFS_LIBRARY} - ${CURL_LIBRARIES} + CURL::libcurl ${LIBXML2_LIBRARIES} ${GUICHAN_LIBRARIES} ${OPENGL_LIBRARIES} -- cgit v1.2.3-70-g09d2