From 3d566f5edeab412e657a2f244ede31861df3a6f5 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Fri, 7 Mar 2025 11:43:51 +0800 Subject: [PATCH] fix build with cmake 4.0 --- ...ncrease-CMake-minimum-version-to-3.5.patch | 40 +++++++++++++++++++ rapidjson.spec | 6 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 backport-Increase-CMake-minimum-version-to-3.5.patch diff --git a/backport-Increase-CMake-minimum-version-to-3.5.patch b/backport-Increase-CMake-minimum-version-to-3.5.patch new file mode 100644 index 0000000..6390ac0 --- /dev/null +++ b/backport-Increase-CMake-minimum-version-to-3.5.patch @@ -0,0 +1,40 @@ +From ebd87cb468fb4cb060b37e579718c4a4125416c1 Mon Sep 17 00:00:00 2001 +From: Christian Fersch +Date: Mon, 15 Jan 2024 07:44:16 +0100 +Subject: [PATCH] Increase CMake minimum version to 3.5 (fixes #2159) + +--- + CMakeLists.txt | 9 +-------- + example/CMakeLists.txt | 2 +- + 2 files changed, 2 insertions(+), 9 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ceda71b..69fb1ee 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,11 +1,4 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +-if(POLICY CMP0025) +- # detect Apple's Clang +- cmake_policy(SET CMP0025 NEW) +-endif() +-if(POLICY CMP0054) +- cmake_policy(SET CMP0054 NEW) +-endif() ++CMAKE_MINIMUM_REQUIRED(VERSION 3.5) + + SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules) + +diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt +index 4d448cc..4abe3db 100644 +--- a/example/CMakeLists.txt ++++ b/example/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.8) ++cmake_minimum_required(VERSION 2.8...${CMAKE_VERSION}) + + if(POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) +-- +2.43.5 + diff --git a/rapidjson.spec b/rapidjson.spec index a82ff89..ba1ee27 100644 --- a/rapidjson.spec +++ b/rapidjson.spec @@ -1,7 +1,7 @@ %global debug_package %{nil} Name: rapidjson Version: 1.1.0 -Release: 15 +Release: 16 Summary: small & selft-contained fast JSON parser and generator for C++ License: MIT URL: http://miloyip.github.io/rapidjson @@ -9,6 +9,7 @@ Source0: https://github.com/miloyip/rapidjson/archive/v%{version}.t Patch0000: rapidjson-1.1.0-do_not_include_gtest_src_dir.patch Patch0001: backport-CVE-2024-38517.patch Patch0002: backport-add-forgotten-ppc64-case.patch +Patch0003: backport-Increase-CMake-minimum-version-to-3.5.patch BuildRequires: cmake gcc-c++ gtest-devel %ifarch %{valgrind_arches} BuildRequires: valgrind @@ -87,6 +88,9 @@ CTEST_EXCLUDE=".*valgrind.*" %doc %{_pkgdocdir} %changelog +* Fri Mar 07 2025 Funda Wang - 1.1.0-16 +- fix build with cmake 4.0 + * Thu Nov 07 2024 Funda Wang - 1.1.0-15 - adopt to new cmake macro -- Gitee