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