From: manish.r Date: Tue, 7 Jan 2020 14:18:41 +0000 (+0530) Subject: Adding gcc verion check for unrecognized options X-Git-Tag: submit/tizen_5.5/20200108.060145^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_5.5;p=platform%2Fadaptation%2Femulator%2Femulator-daemon.git Adding gcc verion check for unrecognized options Change-Id: I579d5985bb94e066b14f839edf38c34563fafaa9 Signed-off-by: manish.r --- diff --git a/packaging/emuld.spec b/packaging/emuld.spec index 50c506f..584fdcb 100644 --- a/packaging/emuld.spec +++ b/packaging/emuld.spec @@ -55,13 +55,24 @@ Emulator daemon library for emuld plugins chmod 644 %{SOURCE0} %setup -q +# Add gcc version check as stringop-overflow stringop-truncation warnings are not introduced by GCC-6 +%define gccversion %(gcc -dumpversion | cut -f1 -d.) + +%if %{gccversion} >= 9 + %define extraflags "-Wno-error=stringop-overflow -Wno-error=sizeof-pointer-memaccess -Wno-error=array-bounds -Wno-error=stringop-truncation" +%else + %define extraflags "-Wno-error=sizeof-pointer-memaccess -Wno-error=array-bounds" +%endif + +echo %{extraflags} + cmake . \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DLIB_INSTALL_DIR=%{_libdir} \ -DEMULD_MAJOR_VERSION=%{emuld_major_version} \ -DEMULD_MINOR_VERSION=%{emuld_minor_version} \ -DEMULD_RELEASE_NUMBER=%{emuld_release_number} \ - -DEXTRA_CFLAGS="-Wno-error=stringop-overflow -Wno-error=sizeof-pointer-memaccess -Wno-error=array-bounds -Wno-error=stringop-truncation" + -DEXTRA_CFLAGS=%{extraflags} %build