From ce726e5d790f3d78a9e3a3c37a60636ae71f116e Mon Sep 17 00:00:00 2001 From: KingYen Date: Fri, 1 Mar 2024 14:56:10 +0800 Subject: [PATCH] Fix cmake compilation issues in risc-v architecture --- cmake.spec | 7 +++++-- fix-clang.patch | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 fix-clang.patch diff --git a/cmake.spec b/cmake.spec index a239562..f9a3a74 100644 --- a/cmake.spec +++ b/cmake.spec @@ -11,7 +11,7 @@ Name: cmake Version: 3.27.9 -Release: 2 +Release: 3 Summary: Cross-platform make system License: BSD and MIT and zlib URL: http://www.cmake.org @@ -25,6 +25,7 @@ Patch0: cmake-findruby.patch %ifarch sw_64 Patch1: cmake-3.22.0-sw.patch %endif +Patch2: fix-clang.patch BuildRequires: coreutils findutils gcc-c++ gcc-gfortran sed BuildRequires: emacs python3-devel pkgconfig(Qt5Widgets) desktop-file-utils @@ -243,6 +244,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %exclude %{_pkgdocdir}/Copyright.txt %changelog +* Fri Mar 01 2024 KingYen - 3.27.9-3 +- Fix cmake compilation issues in risc-v architecture + * Fri Feb 2 2024 liyanan - 3.27.9-2 - Remove Windows_TemporaryKey.pfx @@ -300,4 +304,3 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : * Fri Nov 29 2019 lijin Yang - 3.12.1-2 - init package - diff --git a/fix-clang.patch b/fix-clang.patch new file mode 100644 index 0000000..75d6f42 --- /dev/null +++ b/fix-clang.patch @@ -0,0 +1,14 @@ +diff -u -r cmake-3.24.3/Source/Checks/cm_cxx_features.cmake cmake-3.24.3/Source/Checks/cm_cxx_features.cmake +--- cmake-3.24.3/Source/Checks/cm_cxx_features.cmake 2022-11-01 22:55:49.000000000 +0800 ++++ cmake-3.24.3/Source/Checks/cm_cxx_features.cmake 2023-05-17 22:50:35.000000000 +0800 +@@ -76,8 +76,8 @@ + endfunction() + + cm_check_cxx_feature(make_unique) +-if(CMake_HAVE_CXX_MAKE_UNIQUE) +- set(CMake_HAVE_CXX_UNIQUE_PTR 1) ++if(CMake_HAVE_CXX_MAKE_UNIQUE OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15)) ++ set(CMake_HAVE_CXX_UNIQUE_PTR 1) + endif() + cm_check_cxx_feature(unique_ptr) + if (NOT CMAKE_CXX_STANDARD LESS "17") -- Gitee