Skip to content

Commit fe1ee0f

Browse files
compnerdnwellnhof
authored andcommitted
cmake: 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.
1 parent b347a00 commit fe1ee0f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libxml2-config.cmake.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ if(NOT LIBXML2_SHARED)
157157
endif()
158158

159159
if(WIN32)
160-
list(APPEND LIBXML2_LIBRARIES ws2_32)
160+
list(APPEND LIBXML2_LIBRARIES ws2_32;Bcrypt)
161161
endif()
162162
endif()
163163

libxml2-config.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ if(UNIX)
113113
endif()
114114

115115
if(WIN32)
116-
list(APPEND LIBXML2_LIBRARIES ws2_32)
117-
list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ws2_32>")
116+
list(APPEND LIBXML2_LIBRARIES ws2_32;Bcrypt)
117+
list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ws2_32>;\$<LINK_ONLY:Bcrypt>")
118118
endif()
119119

120120
# whether libxml2 has dso support

0 commit comments

Comments
 (0)