From 4e27bbddfa4ae34926856c3e58ee3c179728233c Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 22 Nov 2024 15:48:07 -0800 Subject: [PATCH] build: add missing `Bcrypt` link on Windows When building on Windows, we must link against `Bcrypt` to satisfy the use of `BCryptGenRandom`. Add this to the link interface in CMake to allow use of libxml2 as a static library. --- libxml2-config.cmake.cmake.in | 2 +- libxml2-config.cmake.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libxml2-config.cmake.cmake.in b/libxml2-config.cmake.cmake.in index aead949be..79e9ecc3b 100644 --- a/libxml2-config.cmake.cmake.in +++ b/libxml2-config.cmake.cmake.in @@ -157,7 +157,7 @@ if(NOT LIBXML2_SHARED) endif() if(WIN32) - list(APPEND LIBXML2_LIBRARIES ws2_32) + list(APPEND LIBXML2_LIBRARIES ws2_32;Bcrypt) endif() endif() diff --git a/libxml2-config.cmake.in b/libxml2-config.cmake.in index 6799fd257..f35eb0562 100644 --- a/libxml2-config.cmake.in +++ b/libxml2-config.cmake.in @@ -113,8 +113,8 @@ if(UNIX) endif() if(WIN32) - list(APPEND LIBXML2_LIBRARIES ws2_32) - list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$") + list(APPEND LIBXML2_LIBRARIES ws2_32;Bcrypt) + list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$;\$") endif() # whether libxml2 has dso support