[gdk-pixbuf] build: Force-include msvc_recommended_pragmas.h on MSVC
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] build: Force-include msvc_recommended_pragmas.h on MSVC
- Date: Thu, 17 Aug 2017 07:18:00 +0000 (UTC)
commit 0b98f7e234ee68067b37eae917559c57592e7d43
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Fri Aug 4 14:57:51 2017 +0800
build: Force-include msvc_recommended_pragmas.h on MSVC
Since we are always building against GLib, make use of the
msvc_recommended_pragmas.h that comes with it, to clean things up a bit,
as that will help us to silence unwanted build warnings as well as
raising attention for warnings that could be potential code issues.
This is the header that is force-included in the Visual Studio projects.
See
https://git.gnome.org/browse/glib/commit/?id=5ba3b4022ebda9e1756d568b7baac7f285bfc0b4 for its use in
building GLib.
https://bugzilla.gnome.org/show_bug.cgi?id=785767
meson.build | 25 ++++---------------------
1 files changed, 4 insertions(+), 21 deletions(-)
---
diff --git a/meson.build b/meson.build
index 13ac26c..8d61e6c 100644
--- a/meson.build
+++ b/meson.build
@@ -92,27 +92,10 @@ common_cflags = []
common_ldflags = []
if cc.get_id() == 'msvc'
- # Compiler options taken from msvc_recommended_pragmas.h
- # in GLib, based on _Win32_Programming_ by Rector and Newcomer
- test_cflags = [
- '-we4002', # too many actual parameters for macro
- '-we4003', # not enough actual parameters for macro
- '-w14010', # single-line comment contains line-continuation character
- '-we4013', # 'function' undefined; assuming extern returning int
- '-w14016', # no function return type; using int as default
- '-we4020', # too many actual parameters
- '-we4021', # too few actual parameters
- '-we4027', # function declared without formal parameter list
- '-we4029', # declared formal parameter list different from definition
- '-we4033', # 'function' must return a value
- '-we4035', # 'function' : no return value
- '-we4045', # array bounds overflow
- '-we4047', # different levels of indirection
- '-we4049', # terminating line number emission
- '-we4053', # an expression of type void was used as an operand
- '-we4071', # no function prototype given
- '-we4819', # the file contains a character that cannot be represented in the current code page
- ]
+ # For Visual Studio, just force-include msvc_reommended_pragmas.h
+ # so that we silence unwanted noise and track potential issues
+ test_cflags = []
+ add_project_arguments([ '-FImsvc_recommended_pragmas.h' ], language: 'c')
elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
test_cflags = [
'-Wpointer-arith',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]