From 05f38b064d7b397c06edb59f6bbd5793e708416b Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Wed, 12 Jul 2023 23:10:24 +0200 Subject: [PATCH] Fix Windows build when linking against current KF5 We need to link against WinSock2 because we use WSAIoctl to set keepalive --- core/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index b47b99bb0..442a6de06 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -65,6 +65,10 @@ PRIVATE KF5::ConfigCore ) +if(WIN32) + target_link_libraries(kdeconnectcore PRIVATE ws2_32.lib) # winsock2 +endif() + if(${KF5KIO_FOUND}) target_link_libraries(kdeconnectcore PUBLIC KF5::KIOCore KF5::KIOGui) endif()