Blame SOURCES/0069-meson-Use-add_project_arguments-for-common-cflags.patch

688edb
From c23e2719bac6d5b1c832ce06d4bc2358f532eb19 Mon Sep 17 00:00:00 2001
688edb
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
688edb
Date: Wed, 4 Dec 2019 12:32:14 +0100
688edb
Subject: [PATCH 069/181] meson: Use add_project_arguments for common cflags
688edb
688edb
We were passing around the common cflags and setting them for each library
688edb
or executable, but this is just a repetition given we can just use
688edb
add_project_arguments for this.
688edb
---
688edb
 demo/meson.build      |  5 +----
688edb
 examples/meson.build  |  6 ++----
688edb
 libfprint/meson.build |  2 +-
688edb
 meson.build           | 13 ++++++++-----
688edb
 4 files changed, 12 insertions(+), 14 deletions(-)
688edb
688edb
diff --git a/demo/meson.build b/demo/meson.build
688edb
index bf7a7ee..279a43c 100644
688edb
--- a/demo/meson.build
688edb
+++ b/demo/meson.build
688edb
@@ -13,10 +13,7 @@ executable('gtk-libfprint-test',
688edb
     include_directories: [
688edb
         root_inc,
688edb
     ],
688edb
-    c_args: [
688edb
-        common_cflags,
688edb
-        '-DPACKAGE_VERSION="' + meson.project_version() + '"'
688edb
-    ],
688edb
+    c_args: '-DPACKAGE_VERSION="' + meson.project_version() + '"',
688edb
     install: true,
688edb
     install_dir: bindir)
688edb
 
688edb
diff --git a/examples/meson.build b/examples/meson.build
688edb
index ff03ac6..eef8c3f 100644
688edb
--- a/examples/meson.build
688edb
+++ b/examples/meson.build
688edb
@@ -6,8 +6,7 @@ foreach example: examples
688edb
         dependencies: [ libfprint_dep, glib_dep ],
688edb
         include_directories: [
688edb
             root_inc,
688edb
-        ],
688edb
-        c_args: common_cflags)
688edb
+        ])
688edb
 endforeach
688edb
 
688edb
 executable('cpp-test',
688edb
@@ -15,5 +14,4 @@ executable('cpp-test',
688edb
     dependencies: libfprint_dep,
688edb
     include_directories: [
688edb
         root_inc,
688edb
-    ],
688edb
-    c_args: common_cflags)
688edb
+    ])
688edb
diff --git a/libfprint/meson.build b/libfprint/meson.build
688edb
index f77965a..964744e 100644
688edb
--- a/libfprint/meson.build
688edb
+++ b/libfprint/meson.build
688edb
@@ -188,7 +188,7 @@ libfprint = library('fprint',
688edb
         drivers_sources + nbis_sources + other_sources,
688edb
     soversion: soversion,
688edb
     version: libversion,
688edb
-    c_args: common_cflags + drivers_cflags,
688edb
+    c_args: drivers_cflags,
688edb
     include_directories: [
688edb
         root_inc,
688edb
         include_directories('nbis/include'),
688edb
diff --git a/meson.build b/meson.build
688edb
index 54761c4..09abc1f 100644
688edb
--- a/meson.build
688edb
+++ b/meson.build
688edb
@@ -10,9 +10,6 @@ project('libfprint', [ 'c', 'cpp' ],
688edb
 
688edb
 gnome = import('gnome')
688edb
 
688edb
-add_project_arguments([ '-D_GNU_SOURCE' ], language: 'c')
688edb
-add_project_arguments([ '-DG_LOG_DOMAIN="libfprint"' ], language: 'c')
688edb
-
688edb
 libfprint_conf = configuration_data()
688edb
 
688edb
 cc = meson.get_compiler('c')
688edb
@@ -23,8 +20,6 @@ glib_min_version = '2.56'
688edb
 glib_version_def = 'GLIB_VERSION_@0@_@1@'.format(
688edb
     glib_min_version.split('.')[0], glib_min_version.split('.')[1])
688edb
 common_cflags = cc.get_supported_arguments([
688edb
-    '-fgnu89-inline',
688edb
-    '-std=gnu99',
688edb
     '-Wall',
688edb
     '-Wtype-limits',
688edb
     '-Wundef',
688edb
@@ -34,7 +29,15 @@ common_cflags = cc.get_supported_arguments([
688edb
     '-Wshadow',
688edb
     '-DGLIB_VERSION_MIN_REQUIRED=' + glib_version_def,
688edb
     '-DGLIB_VERSION_MAX_ALLOWED=' + glib_version_def,
688edb
+    '-D_GNU_SOURCE',
688edb
+    '-DG_LOG_DOMAIN="libfprint"',
688edb
+])
688edb
+c_cflags = cc.get_supported_arguments([
688edb
+    '-fgnu89-inline',
688edb
+    '-std=gnu99',
688edb
 ])
688edb
+add_project_arguments(common_cflags + c_cflags, language: 'c')
688edb
+add_project_arguments(common_cflags, language: 'cpp')
688edb
 
688edb
 # maintaining compatibility with the previous libtool versioning
688edb
 # current = binary - interface
688edb
-- 
688edb
2.24.1
688edb