[libgxps] meson: improve getting the supported flags
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgxps] meson: improve getting the supported flags
- Date: Tue, 27 Mar 2018 20:37:34 +0000 (UTC)
commit f1b75946bd8145bf188980d70e475126e0284a0e
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date: Tue Mar 27 22:36:54 2018 +0200
meson: improve getting the supported flags
meson.build | 38 ++++++--------------------------------
1 files changed, 6 insertions(+), 32 deletions(-)
---
diff --git a/meson.build b/meson.build
index 1c7c2ef..757afe2 100644
--- a/meson.build
+++ b/meson.build
@@ -40,30 +40,10 @@ host_system = host_machine.system()
# Compiler flags
if cc.get_id() == 'msvc'
- # Make MSVC more pedantic, this is a recommended pragma list
- # from _Win32_Programming_ by Rector and Newcomer. Taken from
- # glib's msvc_recommended_pragmas.h--please see that file for
- # the meaning of the warning codes used here
- 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
- ]
-elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
+ # Compiler options taken from msvc_recommended_pragmas.h
+ # in GLib, based on _Win32_Programming_ by Rector and Newcomer
+ common_flags = ['-FImsvc_recommended_pragmas.h']
+else
test_cflags = [
'-Wpointer-arith',
'-Wmissing-declarations',
@@ -97,15 +77,9 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
'-fno-strict-aliasing',
'-Wno-int-conversion',
]
-else
- test_cflags = []
+
+ common_flags = cc.get_supported_arguments(test_cflags)
endif
-common_flags = []
-foreach cflag: test_cflags
- if cc.has_argument(cflag)
- common_flags += [ cflag ]
- endif
-endforeach
extra_args= []
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]