Use warning suppression options only when gcc-9 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified accepted/tizen_unified tizen tizen_6.0 tizen_6.0_hotfix tizen_6.5 accepted/tizen/6.0/unified/20201030.110730 accepted/tizen/6.0/unified/hotfix/20201102.234848 accepted/tizen/6.0/unified/hotfix/20201103.051817 accepted/tizen/6.5/unified/20211029.013951 accepted/tizen/unified/20200116.105956 submit/tizen/20200116.034238 submit/tizen_6.0/20201029.205502 submit/tizen_6.0_hotfix/20201102.192902 submit/tizen_6.0_hotfix/20201103.115102 submit/tizen_6.5/20211028.163501 tizen_6.0.m2_release tizen_6.5.m2_release
authorWonyoung Choi <wy80.choi@samsung.com>
Thu, 16 Jan 2020 03:40:14 +0000 (12:40 +0900)
committerWonyoung Choi <wy80.choi@samsung.com>
Thu, 16 Jan 2020 03:40:14 +0000 (12:40 +0900)
Change-Id: I0be120ae2a4e369045772b2b80e17834cfd74945

packaging/libSkiaSharp.spec

index 4fac491..776c97e 100644 (file)
@@ -70,6 +70,23 @@ for ext in $(ls -1 packaging/externals.*.tar.gz); do
 done
 
 %build
+
+# test gcc options
+echo "int main() { return 0; }" > gcc-test.c && gcc gcc-test.c -Wno-error=class-memaccess && use_gcc9=yes || use_gcc9=no
+
+# suppress gcc warnings
+if [ $use_gcc9 == "yes" ]; then
+  nowarn='"-Wno-unused-function",
+          "-Wno-error=deprecated-copy",
+          "-Wno-error=uninitialized",
+          "-Wno-error=class-memaccess",
+          "-Wno-error=deprecated-copy",
+          "-Wno-error=redundant-move",
+          "-Wno-error=implicit-fallthrough"'
+else
+  nowarn='"-Wno-unused-function"'
+fi
+
 %{_BINDIR}/gn gen out/Tizen --args='
         is_official_build=true
         skia_enable_tools=false
@@ -85,20 +102,11 @@ done
         skia_use_system_libpng=true
         skia_use_system_libwebp=false
         skia_use_system_zlib=true
-        extra_cflags=[
-          "-DSKIA_C_DLL", "-DSK_BUILD_FOR_TIZEN", "-DSK_BUILD_FOR_UNIX"
-          , "-DSK_INTERNAL", "-DSK_SUPPORT_GPU=1"
-          , "-Wno-unused-function"
-          , "-Wno-error=deprecated-copy"
-          , "-Wno-error=uninitialized"
-          , "-Wno-error=class-memaccess"
-          , "-Wno-error=deprecated-copy"
-          , "-Wno-error=redundant-move"
-          , "-Wno-error=implicit-fallthrough"
+        extra_cflags=["-DSKIA_C_DLL", "-DSK_BUILD_FOR_TIZEN", "-DSK_BUILD_FOR_UNIX", "-DSK_INTERNAL", "-DSK_SUPPORT_GPU=1",
 %ifarch %arm
-          , "-mfpu=%{MFPU}", "-mfloat-abi=softfp"
+                      "-mfpu=%{MFPU}", "-mfloat-abi=softfp",
 %endif
-        ] '
+        '" $nowarn ]"
 
 ninja -C out/Tizen