Improve support for clang-cl on windows 84/289484/1
authorPeter Vullings <peter@projectitis.com>
Fri, 13 May 2022 15:17:30 +0000 (03:17 +1200)
committerPatryk Kaczmarek <patryk.k@partner.samsung.com>
Thu, 9 Mar 2023 00:36:52 +0000 (01:36 +0100)
* Better support for clang-cl on windows
* Fix runtime error caused by removing unwind tables

Change-Id: If794b2d1db46c1353bc3b9c391656ff6fa0c6c32

src/meson.build

index 26aba33cae09eecfa87b93b71b2c948d72ebd12a..a2d4d23d1c3a4eb05ff672b4fc12e808e3194230 100644 (file)
@@ -1,7 +1,19 @@
 compiler_flags = ['-DTVG_BUILD']
-
+override_options = []
 cc = meson.get_compiler('cpp')
-if (cc.get_id() != 'msvc')
+if (cc.get_id() == 'clang-cl')
+    if simd_type == 'avx'
+        compiler_flags += ['/clang:-mavx']
+    endif
+    if simd_type == 'neon'
+        compiler_flags += ['/clang:-mfpu=neon']
+    endif
+    if get_option('b_sanitize') == 'none'
+        override_options += ['cpp_eh=none','cpp_rtti=false']
+        compiler_flags += ['/clang:-fno-math-errno',
+                           '/clang:-Woverloaded-virtual', '/clang:-Wno-unused-value', '-Wno-deprecated-declarations']
+    endif
+elif (cc.get_id() != 'msvc')
     if simd_type == 'avx'
         compiler_flags += ['-mavx']
     endif
@@ -36,6 +48,7 @@ thorvg_lib = library(
     install                : true,
     cpp_args               : compiler_flags,
     gnu_symbol_visibility  : 'hidden',
+    override_options       : override_options
 )
 
 thorvg_dep = declare_dependency(