[atk/gnome-3-32: 4/27] build: Use Meson to test for compiler and linker arguments



commit 7d0b258be2130f1ec420ae586d51cc0b497f5044
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Jun 19 14:41:04 2018 +0100

    build: Use Meson to test for compiler and linker arguments
    
    Instead of iterating over them ourselves, Meson 0.46 provides useful
    convenience functions.
    
    Using the appropriate Meson functions also removes warnings with newer
    versions of Meson.

 meson.build | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/meson.build b/meson.build
index 5f68bcf..c7512e0 100644
--- a/meson.build
+++ b/meson.build
@@ -65,19 +65,12 @@ if get_option('default_library') != 'static'
 endif
 
 # Check all compiler flags
-foreach cflag: test_cflags
-  if cc.has_argument(cflag)
-    common_cflags += [ cflag ]
-  endif
-endforeach
+common_cflags += cc.get_supported_arguments(test_cflags)
 
 # Linker flags
 if host_machine.system() == 'linux'
-  foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
-    if cc.has_argument(ldflag)
-      common_ldflags += [ ldflag ]
-    endif
-  endforeach
+  test_ldflags = [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
+  common_ldflags += cc.get_supported_link_arguments(test_ldflags)
 endif
 
 # Maintain compatibility with autotools on macOS


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