From f925d6d3ad75cd9bda5a27435a8c5b713254aad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Stresing?= Date: Fri, 20 Dec 2024 22:32:40 +0100 Subject: [PATCH] Fix mingw build --- src/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 22d4e4f..b53fb93 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -171,8 +171,14 @@ target_compile_definitions(onvifcommon PUBLIC WITH_SELF_PIPE PUBLIC WITH_DOM) if (HAS_OPENSSL) target_link_libraries(onvifcommon "${OpenSSL_ssl_PATH}" "${OpenSSL_cryptro_PATH}") endif () -if (WIN32 AND NOT BUILD_SHARED_LIBS) - target_link_libraries(onvifcommon qtpcre2.lib version.lib Winmm.lib Netapi32.lib Userenv.lib) +if (WIN32) + target_link_libraries(onvifcommon ws2_32) + if (NOT BUILD_SHARED_LIBS) + target_link_libraries(onvifcommon version Winmm Netapi32 Userenv) + if (HAS_OPENSSL) + target_link_libraries(onvifcommon crypt32) + endif () + endif () endif () target_compile_features(onvifcommon PUBLIC cxx_strong_enums cxx_auto_type cxx_nullptr cxx_long_long_type cxx_explicit_conversions) set_target_properties(onvifcommon PROPERTIES PUBLIC_HEADER "${public_header_files};${CMAKE_CURRENT_BINARY_DIR}/OnvifCommonExport.h")