!6 Fix compilation failure due to cmocka update to 1.1.7

From: @starlet-dx 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
This commit is contained in:
openeuler-ci-bot 2023-06-21 13:44:58 +00:00 committed by Gitee
commit 26a200bf41
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From 850f24c6366abda30bfd77734b90330b8809d306 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Fri, 17 Feb 2023 17:51:27 +0100
Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
---
tests/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 635e86e..68e050e 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,5 +1,9 @@
project(tests C)
+if (TARGET cmocka::cmocka)
+ set(CMOCKA_LIBRARY cmocka::cmocka)
+endif()
+
add_library(uwrap_fake_socket_wrapper SHARED uwrap_fake_socket_wrapper.c)
target_compile_options(uwrap_fake_socket_wrapper
PRIVATE
--
2.39.2

View File

@ -1,6 +1,6 @@
Name: uid_wrapper
Version: 1.3.0
Release: 1
Release: 2
Summary: A wrapper for privilege separation
License: GPLv3+
URL: http://cwrap.org/
@ -8,6 +8,7 @@ Source0: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz
Source1: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz.asc
Source2: uid_wrapper.keyring
Patch0: uid_wrapper-fix-cmocka-1.1.6+-support.patch
BuildRequires: cmake libcmocka-devel >= 1.1.0 gcc gnupg2 pkgconfig
@ -68,6 +69,9 @@ make test || find Testing -name "*.log" | xargs cat
%{_mandir}/man1/uid_wrapper.1*
%changelog
* Wed Jun 21 2023 yaoxin <yao_xin001@hoperun.com> - 1.3.0-2
- Fix compilation failure due to cmocka update to 1.1.7
* Tue Feb 14 2023 lilong <lilong@kylinos.cn> - 1.3.0-1
- Upgrade to 1.3.0