Blame SOURCES/0149-meson-Define-enum-dependency-and-ensure-we-generate-.patch

73b847
From ea3af999b3da79725b51411dc757919a23755f7e Mon Sep 17 00:00:00 2001
73b847
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
73b847
Date: Tue, 17 Dec 2019 07:02:16 +0100
73b847
Subject: [PATCH 149/181] meson: Define enum dependency and ensure we generate
73b847
 them before using
73b847
73b847
Avoid setting the headers as sources everywhere, but instead use a dependency
73b847
to manage the headers creation in time
73b847
---
73b847
 libfprint/meson.build | 20 ++++++++++++++++----
73b847
 1 file changed, 16 insertions(+), 4 deletions(-)
73b847
73b847
diff --git a/libfprint/meson.build b/libfprint/meson.build
73b847
index 382fe76..d812cd9 100644
73b847
--- a/libfprint/meson.build
73b847
+++ b/libfprint/meson.build
73b847
@@ -184,6 +184,10 @@ fpi_enums = gnome.mkenums_simple('fpi-enums',
73b847
     install_header : false)
73b847
 fpi_enums_h = fpi_enums[1]
73b847
 
73b847
+enums_dep = declare_dependency(
73b847
+    sources: [ fp_enums_h, fpi_enums_h ]
73b847
+)
73b847
+
73b847
 drivers_sources += configure_file(input: 'empty_file',
73b847
     output: 'fpi-drivers.c',
73b847
     capture: true,
73b847
@@ -193,6 +197,7 @@ drivers_sources += configure_file(input: 'empty_file',
73b847
     ])
73b847
 
73b847
 deps = [
73b847
+    enums_dep,
73b847
     gio_dep,
73b847
     glib_dep,
73b847
     gusb_dep,
73b847
@@ -218,13 +223,16 @@ libnbis = static_library('nbis',
73b847
     install: false)
73b847
 
73b847
 libfprint_private = static_library('fprint-private',
73b847
-    sources: libfprint_private_sources + fpi_enums + [ fp_enums_h ],
73b847
+    sources: [
73b847
+        fpi_enums,
73b847
+        libfprint_private_sources,
73b847
+    ],
73b847
     dependencies: deps,
73b847
     link_with: libnbis,
73b847
     install: false)
73b847
 
73b847
 libfprint_drivers = static_library('fprint-drivers',
73b847
-    sources: drivers_sources + [ fp_enums_h ],
73b847
+    sources: drivers_sources,
73b847
     c_args: drivers_cflags,
73b847
     dependencies: deps,
73b847
     link_with: libfprint_private,
73b847
@@ -234,7 +242,11 @@ mapfile = files('libfprint.ver')
73b847
 vflag = '-Wl,--version-script,@0@/@1@'.format(meson.source_root(), mapfile[0])
73b847
 
73b847
 libfprint = library('fprint',
73b847
-    sources: libfprint_sources + fp_enums + other_sources,
73b847
+    sources: [
73b847
+        fp_enums,
73b847
+        libfprint_sources,
73b847
+        other_sources,
73b847
+    ],
73b847
     soversion: soversion,
73b847
     version: libversion,
73b847
     link_args : vflag,
73b847
@@ -244,9 +256,9 @@ libfprint = library('fprint',
73b847
     install: true)
73b847
 
73b847
 libfprint_dep = declare_dependency(link_with: libfprint,
73b847
-    sources: [ fp_enums_h ],
73b847
     include_directories: root_inc,
73b847
     dependencies: [
73b847
+        enums_dep,
73b847
         gio_dep,
73b847
         glib_dep,
73b847
         gusb_dep,
73b847
-- 
73b847
2.24.1
73b847