Skip to content

Commit 98391be

Browse files
GeorgeSapkinhnyman
authored andcommitted
zmq: add cmake 4.x compatibility
Add upstream patches. Signed-off-by: George Sapkin <[email protected]>
1 parent ae8e14e commit 98391be

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed

libs/zmq/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
1111

1212
PKG_NAME:=zeromq
1313
PKG_VERSION:=4.3.5
14-
PKG_RELEASE:=1
14+
PKG_RELEASE:=2
1515

1616
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
1717
PKG_SOURCE_URL:=https://github.com/zeromq/libzmq/releases/download/v$(PKG_VERSION)

libs/zmq/patches/029-cmake-1.patch

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 34f7fa22022bed9e0e390ed3580a1c83ac4a2834 Mon Sep 17 00:00:00 2001
2+
From: rp42 <[email protected]>
3+
Date: Mon, 30 Dec 2024 11:01:39 +0000
4+
Subject: [PATCH] cmake_minimum_required() before project()
5+
6+
* Without this CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded (MT) Windows builds still produced incompatible MultiThreadedDLL (MD) output.
7+
8+
* Resolves following warning:
9+
10+
CMake Warning (dev) at CMakeLists.txt:2 (project):
11+
cmake_minimum_required() should be called prior to this top-level project()
12+
call.
13+
14+
* Use ${CMAKE_HOST_SYSTEM_NAME} as ${CMAKE_SYSTEM_NAME} not set before project().
15+
---
16+
CMakeLists.txt | 5 +++--
17+
1 file changed, 3 insertions(+), 2 deletions(-)
18+
19+
--- a/CMakeLists.txt
20+
+++ b/CMakeLists.txt
21+
@@ -1,12 +1,13 @@
22+
# CMake build script for ZeroMQ
23+
-project(ZeroMQ)
24+
25+
-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
26+
+if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Darwin)
27+
cmake_minimum_required(VERSION 3.0.2)
28+
else()
29+
cmake_minimum_required(VERSION 2.8.12)
30+
endif()
31+
32+
+project(ZeroMQ)
33+
+
34+
include(CheckIncludeFiles)
35+
include(CheckCCompilerFlag)
36+
include(CheckCXXCompilerFlag)

libs/zmq/patches/030-cmake-2.patch

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From b91a6201307b72beb522300366aad763d19b1456 Mon Sep 17 00:00:00 2001
2+
From: Min RK <[email protected]>
3+
Date: Thu, 20 Mar 2025 14:51:18 +0100
4+
Subject: [PATCH] set upper bound in cmake_minimum_required
5+
6+
setting an upper bound improves forward-compatibility as legacy version support is dropped
7+
8+
- 3.5 compat is deprecated in 3.27 (2023), removed in 4.0 (2025)
9+
- 3.10 compat is deprecated in 3.31 (2024)
10+
---
11+
CMakeLists.txt | 4 ++--
12+
tests/CMakeLists.txt | 2 +-
13+
unittests/CMakeLists.txt | 2 +-
14+
3 files changed, 4 insertions(+), 4 deletions(-)
15+
16+
--- a/CMakeLists.txt
17+
+++ b/CMakeLists.txt
18+
@@ -1,9 +1,9 @@
19+
# CMake build script for ZeroMQ
20+
21+
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Darwin)
22+
- cmake_minimum_required(VERSION 3.0.2)
23+
+ cmake_minimum_required(VERSION 3.0.2...3.31)
24+
else()
25+
- cmake_minimum_required(VERSION 2.8.12)
26+
+ cmake_minimum_required(VERSION 2.8.12...3.31)
27+
endif()
28+
29+
project(ZeroMQ)
30+
--- a/tests/CMakeLists.txt
31+
+++ b/tests/CMakeLists.txt
32+
@@ -1,5 +1,5 @@
33+
# CMake build script for ZeroMQ tests
34+
-cmake_minimum_required(VERSION "2.8.1")
35+
+cmake_minimum_required(VERSION 2.8.1...3.31)
36+
37+
# On Windows: solution file will be called tests.sln
38+
project(tests)
39+
--- a/unittests/CMakeLists.txt
40+
+++ b/unittests/CMakeLists.txt
41+
@@ -1,5 +1,5 @@
42+
# CMake build script for ZeroMQ unit tests
43+
-cmake_minimum_required(VERSION "2.8.1")
44+
+cmake_minimum_required(VERSION 2.8.1...3.31)
45+
46+
set(unittests
47+
unittest_ypipe

0 commit comments

Comments
 (0)