Fix building with cmocka >= 1.1.6

This commit is contained in:
Andreas Schneider 2023-02-23 15:39:04 +01:00
parent 3eb50d44f7
commit c7d73ab913
2 changed files with 40 additions and 3 deletions

View File

@ -0,0 +1,33 @@
From 97fe09e583f6e2ef94623c872e0c56bcd8817303 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 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 6c3aae9..3748461 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -7,6 +7,11 @@ include_directories(
${CMOCKA_INCLUDE_DIR}
)
+# Required for cmocka >= 1.1.6
+if (TARGET cmocka::cmocka)
+ set(CMOCKA_LIBRARY cmocka::cmocka)
+endif()
+
set(TORTURE_LIBRARY torture)
# RFC862 echo server
--
2.39.2

View File

@ -1,14 +1,15 @@
Name: socket_wrapper
Version: 1.4.0
Release: 1%{?dist}
Release: 2%{?dist}
License: BSD
License: BSD-3-Clause
Summary: A library passing all socket communications through Unix sockets
Url: http://cwrap.org/
Source0: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz
Source1: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz.asc
Source2: socket_wrapper.keyring
Patch0: socket_wrapper-fix-cmocka-1.1.6+-support.patch
BuildRequires: cmake
BuildRequires: gcc
@ -48,7 +49,7 @@ Development headers for applications with the need to call
socket_wrapper_enabled().
%prep
gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%autosetup -p1
%build
@ -90,6 +91,9 @@ LD_PRELOAD=%{__cmake_builddir}/src/libsocket_wrapper.so bash -c '>/dev/null'
%{_libdir}/pkgconfig/socket_wrapper_noop.pc
%changelog
* Thu Feb 23 2023 Andreas Schneider <asn@redhat.com> - 1.4.0-2
- Fix building with cmocka >= 1.1.6
* Thu Jan 19 2023 Andreas Schneider <asn@redhat.com> - 1.4.0-1
- Update to version 1.4.0
* https://gitlab.com/cwrap/socket_wrapper/-/blob/socket_wrapper-1.4.0/CHANGELOG