From d714518ce03e87ac4f8ff8a9b4aae32c099fcdce Mon Sep 17 00:00:00 2001 From: Youngjae Shin Date: Wed, 26 Jan 2022 14:50:05 +0900 Subject: [PATCH] revise gcov option on rpm spec Change-Id: Ibe1242c4a0f476fd9c11c75d6f27809762550c9c --- CMakeLists.txt | 2 +- packaging/capi-context-motion.spec | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 304884b..51aef57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 3.9) PROJECT(capi-context-motion) INCLUDE(GNUInstallDirs) diff --git a/packaging/capi-context-motion.spec b/packaging/capi-context-motion.spec index 8407b84..826b53c 100644 --- a/packaging/capi-context-motion.spec +++ b/packaging/capi-context-motion.spec @@ -23,13 +23,20 @@ Provides: libcore-context-manager.so.1 %description Tizen Native Motion Recognition API +%if "%{gcov}" == "0" +%global gcov 0 +%else +%{?gcov: %global gcov 1} +%{!?gcov: %global gcov 0} +%endif + %prep %setup -q %build MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -%if 0%{?gcov:1} +%if %{gcov} export CFLAGS+=" -fprofile-arcs -ftest-coverage" export CXXFLAGS+=" -fprofile-arcs -ftest-coverage" export FFLAGS+=" -fprofile-arcs -ftest-coverage" @@ -43,7 +50,7 @@ export CXXFLAGS+=" -Wnon-virtual-dtor" %cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} make %{?_smp_mflags} -%if 0%{?gcov:1} +%if %{gcov} mkdir -p gcov-obj find . -name '*.gcno' -exec cp '{}' gcov-obj ';' %endif @@ -51,9 +58,9 @@ find . -name '*.gcno' -exec cp '{}' gcov-obj ';' %install %make_install -%if 0%{?gcov:1} -mkdir -p %{buildroot}%{_datadir}/gcov/obj -install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +%if %{gcov} +mkdir -p %{buildroot}%{_datadir}/gcov/obj/%{name} +install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name} %endif # For backward compatibility @@ -85,10 +92,11 @@ Tizen Native Motion Recognition API (Development) %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc -%if 0%{?gcov:1} +%if %{gcov} %package gcov Summary: Tizen Native Motion Recognition API (gcov) Group: Service Framework/Testing +BuildRequires: tar %description gcov gcov objects for coverage test -- 2.7.4