From 0153f56c0ca62b07a0ce0b40af5d6497104aed77 Mon Sep 17 00:00:00 2001 From: s Date: Thu, 18 May 2023 23:36:23 +0800 Subject: [PATCH] fix clang build error --- cmake.spec | 6 +++++- fix-clang.patch | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 fix-clang.patch diff --git a/cmake.spec b/cmake.spec index 1615d51..c420335 100644 --- a/cmake.spec +++ b/cmake.spec @@ -11,7 +11,7 @@ Name: cmake Version: 3.24.3 -Release: 1 +Release: 2 Summary: Cross-platform make system License: BSD and MIT and zlib URL: http://www.cmake.org @@ -27,6 +27,7 @@ Patch2: cmake-mingw-dl.patch %ifarch sw_64 Patch3: cmake-3.22.0-sw.patch %endif +Patch4: fix-clang.patch BuildRequires: coreutils findutils gcc-c++ gcc-gfortran sed BuildRequires: emacs python3-devel pkgconfig(Qt5Widgets) desktop-file-utils @@ -238,6 +239,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %exclude %{_pkgdocdir}/Copyright.txt %changelog +* Thu May 18 2023 yoo - 3.24.3-2 +- fix clang build error + * Mon Nov 14 2022 jchzhou - 3.24.3-1 - Update to 3.24.3 diff --git a/fix-clang.patch b/fix-clang.patch new file mode 100644 index 0000000..45ff9fc --- /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