[openwrt/openwrt] libjson-c: patch for cmake 4.x compatibility

LEDE Commits lede-commits at lists.infradead.org
Tue Nov 4 06:15:05 PST 2025


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5a8dffebe9201a42f0a0c9340c25010edc1faeb5

commit 5a8dffebe9201a42f0a0c9340c25010edc1faeb5
Author: Hannu Nyman <hannu.nyman at iki.fi>
AuthorDate: Tue Oct 7 18:30:01 2025 +0300

    libjson-c: patch for cmake 4.x compatibility
    
    Patch CMakeLists.txt in selected apps for cmake 4.x compatibility.
    New cmake versions require at least 3.5 as 'cmake_minimum_required'
    in CMakeLists.txt. In future 3.10 will be required.
    
    Signed-off-by: Hannu Nyman <hannu.nyman at iki.fi>
    Link: https://github.com/openwrt/openwrt/pull/20265
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .../libs/libjson-c/patches/002-cmake-version.patch   | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/package/libs/libjson-c/patches/002-cmake-version.patch b/package/libs/libjson-c/patches/002-cmake-version.patch
new file mode 100644
index 0000000000..e5ad129f0b
--- /dev/null
+++ b/package/libs/libjson-c/patches/002-cmake-version.patch
@@ -0,0 +1,20 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,7 +3,7 @@
+ #   and many OpenWRT packages require, much newer CMake packages.
+ #  We're stopping before 3.10 because that version starts requiring
+ #   c++11, which isn't available on e.g HPUX.
+-cmake_minimum_required(VERSION 3.9...3.12)
++cmake_minimum_required(VERSION 3.10)
+ 
+ # JSON-C library is C only project.
+ # PROJECT_VERSION{,_MAJOR,_MINOR,_PATCH} set by project():
+--- a/apps/CMakeLists.txt
++++ b/apps/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ 
+-cmake_minimum_required(VERSION 2.8)  # see ../CMakeLists.txt for why 2.8
++cmake_minimum_required(VERSION 3.10)
+ 
+ if(POLICY CMP0075)
+     cmake_policy(SET CMP0075 NEW)




More information about the lede-commits mailing list