[epiphany/mcatanzaro/meson-fixes: 1/2] build: check if compiler supports flags before using them



commit e1a1005c48debb01b42cb20348dda18de130035c
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Tue May 7 19:51:43 2019 -0500

    build: check if compiler supports flags before using them

 meson.build | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/meson.build b/meson.build
index 251a5fe57..359ccbf62 100644
--- a/meson.build
+++ b/meson.build
@@ -6,12 +6,6 @@ project('epiphany', 'c',
                     'warning_level=2']
 )
 
-add_project_arguments('-Werror=format-security',
-                      '-Wno-cast-function-type',
-                      '-Wno-missing-field-initializers',
-                      '-Wno-unused-parameter',
-                      language: 'c')
-
 gnome = import('gnome')
 i18n = import('i18n')
 
@@ -127,6 +121,13 @@ cc = meson.get_compiler('c')
 gmp_dep = cc.find_library('gmp')
 m_dep = cc.find_library('m', required: false)
 
+cflags = cc.get_supported_arguments(['-Werror=format-security',
+                                     '-Wno-cast-function-type',
+                                     '-Wno-missing-field-initializers',
+                                     '-Wno-unused-parameter'])
+add_project_arguments(cflags,
+                      language: 'c')
+
 subdir('data')
 subdir('help')
 subdir('po')


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