Skip to content

Commit fefb3bb

Browse files
committed
depends: add zeromq no librt patch
1 parent a522ef1 commit fefb3bb

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

depends/packages/zeromq.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ $(package)_patches += macos_mktemp_check.patch
88
$(package)_patches += builtin_sha1.patch
99
$(package)_patches += fix_have_windows.patch
1010
$(package)_patches += cmake_minimum.patch
11+
$(package)_patches += no_librt.patch
1112

1213
define $(package)_set_vars
1314
$(package)_config_opts = --without-docs --disable-shared --disable-valgrind
@@ -22,7 +23,8 @@ define $(package)_preprocess_cmds
2223
patch -p1 < $($(package)_patch_dir)/macos_mktemp_check.patch && \
2324
patch -p1 < $($(package)_patch_dir)/builtin_sha1.patch && \
2425
patch -p1 < $($(package)_patch_dir)/fix_have_windows.patch && \
25-
patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch
26+
patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch && \
27+
patch -p1 < $($(package)_patch_dir)/no_librt.patch
2628
endef
2729

2830
define $(package)_config_cmds

depends/patches/zeromq/no_librt.patch

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
We don't use librt, so don't try and link against it.
2+
3+
Related to: https://github.com/zeromq/libzmq/pull/4702.
4+
5+
diff --git a/CMakeLists.txt b/CMakeLists.txt
6+
index 03462271..87ceab3c 100644
7+
--- a/CMakeLists.txt
8+
+++ b/CMakeLists.txt
9+
@@ -564,13 +564,6 @@ else()
10+
check_cxx_symbol_exists(SO_BUSY_POLL sys/socket.h ZMQ_HAVE_BUSY_POLL)
11+
endif()
12+
13+
-if(NOT MINGW)
14+
- find_library(RT_LIBRARY rt)
15+
- if(RT_LIBRARY)
16+
- set(pkg_config_libs_private "${pkg_config_libs_private} -lrt")
17+
- endif()
18+
-endif()
19+
-
20+
find_package(Threads)
21+
22+
if(WIN32 AND NOT CYGWIN)
23+
@@ -588,9 +581,7 @@ if(WIN32 AND NOT CYGWIN)
24+
endif()
25+
26+
if(NOT MSVC)
27+
- set(CMAKE_REQUIRED_LIBRARIES rt)
28+
check_cxx_symbol_exists(clock_gettime time.h HAVE_CLOCK_GETTIME)
29+
- set(CMAKE_REQUIRED_LIBRARIES)
30+
31+
check_cxx_symbol_exists(fork unistd.h HAVE_FORK)
32+
check_cxx_symbol_exists(gethrtime sys/time.h HAVE_GETHRTIME)
33+
@@ -1503,10 +1494,6 @@ if(BUILD_SHARED)
34+
target_link_libraries(libzmq iphlpapi)
35+
endif()
36+
37+
- if(RT_LIBRARY)
38+
- target_link_libraries(libzmq -lrt)
39+
- endif()
40+
-
41+
if(norm_FOUND)
42+
target_link_libraries(libzmq norm::norm)
43+
endif()
44+
@@ -1553,10 +1540,6 @@ if(BUILD_STATIC)
45+
target_link_libraries(libzmq-static iphlpapi)
46+
endif()
47+
48+
- if(RT_LIBRARY)
49+
- target_link_libraries(libzmq-static -lrt)
50+
- endif()
51+
-
52+
if(CMAKE_SYSTEM_NAME MATCHES "QNX")
53+
add_definitions(-DUNITY_EXCLUDE_MATH_H)
54+
endif()

0 commit comments

Comments
 (0)