From be1ad4f47588bf183489d05b8308d17390395579 Mon Sep 17 00:00:00 2001 From: Boris Pek Date: Sat, 12 Jan 2019 17:29:17 +0300 Subject: [PATCH] Fix cross-compilation for MS Windows using MinGW [Thanks to Felix Brucker] (Closes: #55) --- CMakeLists.txt | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91fd544..d73a383 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,13 +121,6 @@ add_library(mod_topic MODULE ${PROJECT_SOURCE_DIR}/plugins/mod_topic.c) add_library(mod_no_guest_downloads MODULE ${PROJECT_SOURCE_DIR}/plugins/mod_no_guest_downloads.c) add_library(mod_auth_sqlite MODULE ${PROJECT_SOURCE_DIR}/plugins/mod_auth_sqlite.c) -if(WIN32) - target_link_libraries(uhub ws2_32) - target_link_libraries(autotest-bin ws2_32) - target_link_libraries(mod_logging ws2_32) - target_link_libraries(mod_welcome ws2_32) -endif() - set_target_properties( mod_example mod_welcome @@ -145,19 +138,23 @@ target_link_libraries(uhub ${CMAKE_DL_LIBS} adc network utils) target_link_libraries(uhub-passwd ${SQLITE3_LIBRARIES} utils) target_link_libraries(autotest-bin ${CMAKE_DL_LIBS} adc network utils) target_link_libraries(mod_example utils) -target_link_libraries(mod_welcome utils) +target_link_libraries(mod_welcome network utils) target_link_libraries(mod_auth_simple utils) target_link_libraries(mod_auth_sqlite ${SQLITE3_LIBRARIES} utils) target_link_libraries(mod_chat_history utils) target_link_libraries(mod_chat_history_sqlite ${SQLITE3_LIBRARIES} utils) target_link_libraries(mod_no_guest_downloads utils) target_link_libraries(mod_chat_only utils) -target_link_libraries(mod_logging utils) +target_link_libraries(mod_logging network utils) target_link_libraries(mod_topic utils) target_link_libraries(utils network) -target_link_libraries(mod_welcome network) -target_link_libraries(mod_logging network) +if(WIN32) + target_link_libraries(uhub ws2_32) + target_link_libraries(autotest-bin ws2_32) + target_link_libraries(mod_logging ws2_32) + target_link_libraries(mod_welcome ws2_32) +endif() if(UNIX) add_library(adcclient STATIC ${adcclient_SOURCES})