Adding gcc verion check for unrecognized options 11/221811/2 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5 tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20200108.120703 accepted/tizen/5.5/unified/wearable/hotfix/20201027.122745 submit/tizen_5.5/20200108.060145 submit/tizen_5.5_wearable_hotfix/20201026.184301
authormanish.r <manish.r@samsung.com>
Tue, 7 Jan 2020 14:18:41 +0000 (19:48 +0530)
committermanish.r <manish.r@samsung.com>
Wed, 8 Jan 2020 05:37:47 +0000 (11:07 +0530)
Change-Id: I579d5985bb94e066b14f839edf38c34563fafaa9
Signed-off-by: manish.r <manish.r@samsung.com>
packaging/emuld.spec

index 50c506f549c2e01ba033b6826242e8dff1485ab2..584fdcb24c83a5ae3e35fe080a1d006328f09c17 100644 (file)
@@ -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