[libhandy/msvc-1-6: 9/15] meson.build: Force-include msvc_recommended_pragmas.h




commit 39f71ad04aea9245484e7911ac86e980d61097b2
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jan 19 12:26:31 2022 +0800

    meson.build: Force-include msvc_recommended_pragmas.h
    
    ...on Visual Studio builds, as Visual Studio use a different way to look out
    or ignore the warnings that we want to look out or ignore.

 meson.build | 76 ++++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 40 insertions(+), 36 deletions(-)
---
diff --git a/meson.build b/meson.build
index dbeb4517..382982aa 100644
--- a/meson.build
+++ b/meson.build
@@ -41,42 +41,46 @@ src_inc = include_directories('src')
 cc = meson.get_compiler('c')
 
 global_c_args = []
-test_c_args = [
-  '-Wcast-align',
-  '-Wdate-time',
-  '-Wdeclaration-after-statement',
-  ['-Werror=format-security', '-Werror=format=2'],
-  '-Wendif-labels',
-  '-Werror=incompatible-pointer-types',
-  '-Werror=missing-declarations',
-  '-Werror=overflow',
-  '-Werror=return-type',
-  '-Werror=shift-count-overflow',
-  '-Werror=shift-overflow=2',
-  '-Werror=implicit-fallthrough=3',
-  '-Wformat-nonliteral',
-  '-Wformat-security',
-  '-Winit-self',
-  '-Wmaybe-uninitialized',
-  '-Wmissing-field-initializers',
-  '-Wmissing-include-dirs',
-  '-Wmissing-noreturn',
-  '-Wnested-externs',
-  '-Wno-missing-field-initializers',
-  '-Wno-sign-compare',
-  '-Wno-strict-aliasing',
-  '-Wno-unused-parameter',
-  '-Wold-style-definition',
-  '-Wpointer-arith',
-  '-Wredundant-decls',
-  '-Wshadow',
-  '-Wstrict-prototypes',
-  '-Wswitch-default',
-  '-Wswitch-enum',
-  '-Wtype-limits',
-  '-Wundef',
-  '-Wunused-function',
-]
+if cc.get_id() == 'msvc'
+  test_c_args = [ '-FImsvc_recommended_pragmas.h' ]
+else
+  test_c_args = [
+    '-Wcast-align',
+    '-Wdate-time',
+    '-Wdeclaration-after-statement',
+    ['-Werror=format-security', '-Werror=format=2'],
+    '-Wendif-labels',
+    '-Werror=incompatible-pointer-types',
+    '-Werror=missing-declarations',
+    '-Werror=overflow',
+    '-Werror=return-type',
+    '-Werror=shift-count-overflow',
+    '-Werror=shift-overflow=2',
+    '-Werror=implicit-fallthrough=3',
+    '-Wformat-nonliteral',
+    '-Wformat-security',
+    '-Winit-self',
+    '-Wmaybe-uninitialized',
+    '-Wmissing-field-initializers',
+    '-Wmissing-include-dirs',
+    '-Wmissing-noreturn',
+    '-Wnested-externs',
+    '-Wno-missing-field-initializers',
+    '-Wno-sign-compare',
+    '-Wno-strict-aliasing',
+    '-Wno-unused-parameter',
+    '-Wold-style-definition',
+    '-Wpointer-arith',
+    '-Wredundant-decls',
+    '-Wshadow',
+    '-Wstrict-prototypes',
+    '-Wswitch-default',
+    '-Wswitch-enum',
+    '-Wtype-limits',
+    '-Wundef',
+    '-Wunused-function',
+  ]
+endif
 
 target_system = target_machine.system()
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]