From be76c582646f627c974b2bb1c95c097b19d1924f Mon Sep 17 00:00:00 2001 From: SChernykh Date: Sun, 25 Sep 2022 20:41:10 +0200 Subject: [PATCH] Fixed MSYS2 build --- CMakeLists.txt | 6 ++++++ tests/CMakeLists.txt | 3 +++ 2 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 28c213f..9f1a094 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,9 @@ include_directories(external/src/robin-hood-hashing/src/include) if (WIN32) set(LIBS ${LIBS} ws2_32 iphlpapi userenv psapi) + if (CMAKE_CXX_COMPILER_ID MATCHES GNU) + set(LIBS ${LIBS} bcrypt) + endif() add_definitions(-DCURL_STATICLIB) elseif (CMAKE_SYSTEM_NAME STREQUAL FreeBSD) set(LIBS ${LIBS} pthread) @@ -197,6 +200,9 @@ if (STATIC_BINARY OR STATIC_LIBS) if (WIN32) set(STATIC_LIBS ${STATIC_LIBS} ws2_32 iphlpapi userenv psapi wldap32) + if (CMAKE_CXX_COMPILER_ID MATCHES GNU) + set(STATIC_LIBS ${STATIC_LIBS} bcrypt) + endif() elseif (CMAKE_SYSTEM_NAME STREQUAL FreeBSD) set(STATIC_LIBS ${STATIC_LIBS} pthread) elseif (APPLE) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 392ac34..297af1f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -70,6 +70,9 @@ include_directories(googletest/googletest/include) if (WIN32) set(LIBS ${LIBS} ws2_32 iphlpapi userenv psapi wldap32) + if (CMAKE_CXX_COMPILER_ID MATCHES GNU) + set(LIBS ${LIBS} bcrypt) + endif() add_definitions(-DCURL_STATICLIB) elseif (NOT APPLE) set(LIBS ${LIBS} pthread gss dl)