From: Youngjae Shin Date: Wed, 26 Jan 2022 05:50:05 +0000 (+0900) Subject: revise gcov option on rpm spec X-Git-Tag: submit/tizen/20220126.064839^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_7.0_hotfix;p=platform%2Fcore%2Fapi%2Fmotion.git revise gcov option on rpm spec Change-Id: Ibe1242c4a0f476fd9c11c75d6f27809762550c9c --- 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