File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ $(package)_patches += openbsd_kqueue_headers.patch
12
12
$(package)_patches += cmake_minimum.patch
13
13
$(package)_patches += cacheline_undefined.patch
14
14
$(package)_patches += no_librt.patch
15
+ $(package)_patches += fix_mingw_link.patch
15
16
16
17
define $(package)_set_vars
17
18
$(package ) _config_opts := -DCMAKE_BUILD_TYPE=None -DWITH_DOCS=OFF -DWITH_LIBSODIUM=OFF
@@ -30,7 +31,8 @@ define $(package)_preprocess_cmds
30
31
patch -p1 < $($(package ) _patch_dir) /fix_have_windows.patch && \
31
32
patch -p1 < $($(package ) _patch_dir) /openbsd_kqueue_headers.patch && \
32
33
patch -p1 < $($(package ) _patch_dir) /cmake_minimum.patch && \
33
- patch -p1 < $($(package ) _patch_dir) /no_librt.patch
34
+ patch -p1 < $($(package ) _patch_dir) /no_librt.patch && \
35
+ patch -p1 < $($(package ) _patch_dir) /fix_mingw_link.patch
34
36
endef
35
37
36
38
define $(package)_config_cmds
Original file line number Diff line number Diff line change
1
+ Fix CMake-generated `libzmq.pc` file
2
+
3
+ This change mirrors the Autotools-based build system behavior for
4
+ cross-compiling for Windows with static linking.
5
+
6
+ See https://github.com/zeromq/libzmq/pull/4706.
7
+
8
+
9
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
10
+ index 03462271..0315e606 100644
11
+ --- a/CMakeLists.txt
12
+ +++ b/CMakeLists.txt
13
+ @@ -546,12 +546,18 @@ if(ZMQ_HAVE_WINDOWS)
14
+ # Cannot use check_library_exists because the symbol is always declared as char(*)(void)
15
+ set(CMAKE_REQUIRED_LIBRARIES "ws2_32.lib")
16
+ check_cxx_symbol_exists(WSAStartup "winsock2.h" HAVE_WS2_32)
17
+ + if(HAVE_WS2_32)
18
+ + set(pkg_config_libs_private "${pkg_config_libs_private} -lws2_32")
19
+ + endif()
20
+
21
+ set(CMAKE_REQUIRED_LIBRARIES "rpcrt4.lib")
22
+ check_cxx_symbol_exists(UuidCreateSequential "rpc.h" HAVE_RPCRT4)
23
+
24
+ set(CMAKE_REQUIRED_LIBRARIES "iphlpapi.lib")
25
+ check_cxx_symbol_exists(GetAdaptersAddresses "winsock2.h;iphlpapi.h" HAVE_IPHLAPI)
26
+ + if(HAVE_IPHLAPI)
27
+ + set(pkg_config_libs_private "${pkg_config_libs_private} -liphlpapi")
28
+ + endif()
29
+ check_cxx_symbol_exists(if_nametoindex "iphlpapi.h" HAVE_IF_NAMETOINDEX)
30
+
31
+ set(CMAKE_REQUIRED_LIBRARIES "")
You can’t perform that action at this time.
0 commit comments