From 455c86b5cc98d2398eca96671dc4795f1ac32209 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Sun, 31 Aug 2025 01:50:45 +0800 Subject: [PATCH] fix build with cmake 4 --- ...update-cmake-minimum-support-to-3.16.patch | 40 +++++++++++++++++++ openamp.spec | 6 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 backport-cmake-update-cmake-minimum-support-to-3.16.patch diff --git a/backport-cmake-update-cmake-minimum-support-to-3.16.patch b/backport-cmake-update-cmake-minimum-support-to-3.16.patch new file mode 100644 index 0000000..debd5f7 --- /dev/null +++ b/backport-cmake-update-cmake-minimum-support-to-3.16.patch @@ -0,0 +1,40 @@ +From 8c0c0c386b5799b54faf9613a191f66dee76e400 Mon Sep 17 00:00:00 2001 +From: Arnaud Pouliquen +Date: Thu, 13 Feb 2025 16:53:47 +0100 +Subject: [PATCH] cmake: update cmake minimum support to 3.16 + +We currently support an old version of CMake (3.0.2) that was released +in 2018. + +This requires adding specific policies to support the evolution to the +latest versions of Zephyr. + +Update the minimum version to 3.16, aligned with the libmetal. + +By updating to CMake 3.16 as the minimum version, we can also clean up +the following policy add-ons: +- CMP0048 added in CMake v3.0 +- CMP0077 added in CMake v3.13 + +Signed-off-by: Arnaud Pouliquen +--- + CMakeLists.txt | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8d65132de..0dafaef7d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,11 +1,4 @@ +-cmake_minimum_required (VERSION 3.0.2) +-if (POLICY CMP0048) +- cmake_policy(SET CMP0048 NEW) +-endif() +- +-if (POLICY CMP0077) +- cmake_policy(SET CMP0077 NEW) +-endif() ++cmake_minimum_required (VERSION 3.16) + + set (OPENAMP_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + set (OPENAMP_BIN_ROOT "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/openamp.spec b/openamp.spec index 5d1a633..3508a40 100644 --- a/openamp.spec +++ b/openamp.spec @@ -1,6 +1,6 @@ Name: openamp Version: 2022.10.1 -Release: 7 +Release: 8 Summary: Open asymmetric multiprocessing framework License: BSD-3-Clause @@ -10,6 +10,7 @@ Source0: https://github.com/OpenAMP/open-amp/archive/refs/tags/v%{version}/%{nam Patch0001:0001-apps-Fix-atomic_flag-error-for-clang-compilation.patch Patch0002:0002-lib-Fix-atomic_flag-error-for-clang-compilation.patch Patch0003:0001-remoteproc-Fix-management-of-non-loadable-program-se.patch +Patch0004:backport-cmake-update-cmake-minimum-support-to-3.16.patch BuildRequires: cmake BuildRequires: gcc @@ -66,6 +67,9 @@ baremetal, and RTOS environments. %{_bindir}/*-shared %changelog +* Sun Aug 31 2025 Funda Wang - 2022.10.1-8 +- fix build with cmake 4 + * Tue Feb 18 2025 Funda Wang - 2022.10.1-7 - adopt to new cmake macro -- Gitee