[dconf/wip/inigomartinez/meson: 4/14] build: Use get_supported_arguments helper



commit 5220ec2453f9f1b9c573b752855ecdcd3d1df784
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Sun Nov 12 11:48:07 2017 +0100

    build: Use get_supported_arguments helper
    
    meson 0.43.0 comes with a new function in the compiler's object
    called `get_supported_arguments`, which allows checking multiple
    optiones at once.
    
    This patch bumps meson's version number and also takes advantage
    of this new feature.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790236

 common/meson.build |    6 +-----
 meson.build        |    8 ++------
 2 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/common/meson.build b/common/meson.build
index c431fe9..28427f6 100644
--- a/common/meson.build
+++ b/common/meson.build
@@ -38,11 +38,7 @@ libdconf_common_shared = static_library(
   pic: true
 )
 
-test_cflag = '-fvisibility=hidden'
-
-if cc.has_argument(test_cflag)
-  cflags += [test_cflag]
-endif
+cflags += cc.get_supported_arguments('-fvisibility=hidden')
 
 libdconf_common_hidden = static_library(
   name + '-hidden',
diff --git a/meson.build b/meson.build
index 276e227..59b3176 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project(
   'dconf', ['c', 'vala'],
   version: '0.28.0',
   license: 'LGPL2.1+',
-  meson_version: '>= 0.41.0'
+  meson_version: '>= 0.43.0'
 )
 
 dconf_version = meson.project_version()
@@ -58,11 +58,7 @@ if get_option('buildtype').contains('debug')
     '-Wwrite-strings'
   ]
 
-  foreach cflag: test_cflags
-    if cc.has_argument(cflag)
-      common_flags += [cflag]
-    endif
-  endforeach
+  common_flags += cc.get_supported_arguments(test_cflags)
 endif
 
 add_project_arguments(common_flags, language: 'c')


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