tools/cmake: update to 4.1.2

Update cmake to 4.1.2.
Note that cmake 4.x requires at least 3.5 as 'cmake_minimum_required'
in CMakeLists.txt of each app to be compiled.

Future cmake versions will increase that requirement to 3.10
https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/20265
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Hannu Nyman 2025-10-07 18:30:01 +03:00 committed by Christian Marangi
parent 261275c72c
commit 1b48ebd31c
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7
8 changed files with 10 additions and 48 deletions

View File

@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=cmake
PKG_VERSION:=3.31.5
PKG_VERSION:=4.1.2
PKG_VERSION_MAJOR:=$(word 1,$(subst ., ,$(PKG_VERSION))).$(word 2,$(subst ., ,$(PKG_VERSION)))
PKG_RELEASE:=1
PKG_CPE_ID:=cpe:/a:kitware:cmake
@ -15,7 +15,7 @@ PKG_CPE_ID:=cpe:/a:kitware:cmake
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \
https://cmake.org/files/v$(PKG_VERSION_MAJOR)/
PKG_HASH:=66fb53a145648be56b46fa9e8ccade3a4d0dfc92e401e52ce76bdad1fea43d27
PKG_HASH:=643f04182b7ba323ab31f526f785134fb79cba3188a852206ef0473fee282a15
HOST_BUILD_PARALLEL:=1
HOST_CONFIGURE_PARALLEL:=1

View File

@ -1,6 +1,6 @@
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -47,7 +47,7 @@ the :variable:`CTEST_USE_LAUNCHERS` vari
@@ -60,7 +60,7 @@ the :variable:`CTEST_USE_LAUNCHERS` vari
in the ``CTestConfig.cmake`` file.
#]=======================================================================]

View File

@ -1,6 +1,6 @@
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -61,7 +61,13 @@ The following variables are provided for
@@ -82,7 +82,13 @@ Finding the liblzma library and linking
cmake_policy(PUSH)
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>

View File

@ -1,38 +0,0 @@
From: Jo-Philipp Wich <jo@mein.io>
Date: Wed, 11 Jan 2017 03:36:04 +0100
Subject: [PATCH] cmcurl: link librt
When cmake is linked against LibreSSL, there might be an indirect
dependency on librt on certain systems if LibreSSL's libcrypto uses
clock_gettime() from librt:
[ 28%] Linking C executable LIBCURL
.../lib/libcrypto.a(getentropy_linux.o): In function `getentropy_fallback':
getentropy_linux.c:(.text+0x16d): undefined reference to `clock_gettime'
getentropy_linux.c:(.text+0x412): undefined reference to `clock_gettime'
collect2: error: ld returned 1 exit status
make[5]: *** [Utilities/cmcurl/LIBCURL] Error 1
Modify the cmcurl CMakeLists.txt to check for clock_gettime() in librt
and unconditionally link the rt library when the symbol is found.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
---
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -775,7 +775,14 @@ if(CURL_USE_OPENSSL)
endif()
set(_ssl_enabled ON)
set(USE_OPENSSL ON)
-
+ check_library_exists("rt" clock_gettime "" HAVE_LIBRT)
+ if(HAVE_LIBRT)
+ list(APPEND OPENSSL_LIBRARIES rt)
+ endif()
+ check_library_exists("pthread" pthread_once "" HAVE_PTHREAD)
+ if(HAVE_PTHREAD)
+ list(APPEND OPENSSL_LIBRARIES pthread)
+ endif()
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})
include_directories(${OPENSSL_INCLUDE_DIR})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "openssl")

View File

@ -1,6 +1,6 @@
--- a/bootstrap
+++ b/bootstrap
@@ -1514,7 +1514,10 @@ int main(){ printf("1%c", (char)0x0a); r
@@ -1520,7 +1520,10 @@ int main(){ printf("1%c", (char)0x0a); r
' > "test.c"
cmake_original_make_flags="${cmake_make_flags}"
if test "x${cmake_parallel_make}" != "x"; then

View File

@ -1,6 +1,6 @@
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -120,10 +120,13 @@ else()
@@ -147,10 +147,13 @@ else()
set(ZLIB_NAMES_DEBUG zd zlibd zdlld zlibd1 zlib1d zlibstaticd zlibwapid zlibvcd zlibstatd)
endif()

View File

@ -1,6 +1,6 @@
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -680,7 +680,7 @@ IF(ENABLE_ZSTD)
@@ -655,7 +655,7 @@ IF(ENABLE_ZSTD)
SET(ZSTD_FIND_QUIETLY TRUE)
ENDIF (ZSTD_INCLUDE_DIR)

View File

@ -1,6 +1,6 @@
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -888,7 +888,7 @@ if(CMake_USE_XCOFF_PARSER)
@@ -886,7 +886,7 @@ if(CMake_USE_XCOFF_PARSER)
endif()
# Xcode only works on Apple
@ -11,8 +11,8 @@
PRIVATE
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -133,7 +133,7 @@
# include "cmGlobalGhsMultiGenerator.h"
@@ -138,7 +138,7 @@
# endif
#endif
-#if defined(__APPLE__)