From 6d44a93eaf48896e7b89647e17d2c1abc24238d4 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 21 Feb 2020 10:37:59 +0100 Subject: [PATCH] Linking, mingw: Add bcrypt to libraries linked to libcommon. It is already added with MSVC, and must be added with gcc/mingw However, the cmake option: add_definitions( -DBOOST_UUID_FORCE_AUTO_LINK ) does not work on msys2 (at least with my cmake version), so another syntax is used. --- CMakeLists.txt | 3 +++ common/CMakeLists.txt | 1 + 2 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e85ca3af2..994bd80436 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -389,6 +389,9 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) # API with respect to the C99 standard, so make sure we force it to use its own compliant # snprintf add_definitions(-D__USE_MINGW_ANSI_STDIO=1) + + # Allow linking for Boost for the UUID against bcrypt + set( EXTRA_LIBS "bcrypt" ) elseif( NOT APPLE ) # Thou shalt not link vaporware and tell us it's a valid DSO (apple ld doesn't support it) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index b762335174..449ce5ec52 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -417,6 +417,7 @@ target_link_libraries( common ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} # empty on Apple ${wxWidgets_LIBRARIES} + ${EXTRA_LIBS} ) target_include_directories( common PUBLIC