[glib] meson: Improve gdbus-codegen custom target dependencies



commit b444ae0de2674a9c68e06324e63023e72736e149
Author: Nirbheek Chauhan <nirbheek centricular com>
Date:   Wed Oct 11 16:06:58 2017 +0530

    meson: Improve gdbus-codegen custom target dependencies
    
    Ensure that the custom targets that use gdbus-codegen get rebuilt when
    any of the gdbus-codegen files are changed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752239

 gio/gdbus-2.0/codegen/meson.build |   20 ++++++++++----------
 gio/meson.build                   |    2 ++
 gio/tests/meson.build             |    1 +
 3 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build
index aca4a46..54a86b0 100644
--- a/gio/gdbus-2.0/codegen/meson.build
+++ b/gio/gdbus-2.0/codegen/meson.build
@@ -23,19 +23,19 @@ gdbus_codegen = configure_file(input : 'gdbus-codegen.in',
 
 codegen_dir = join_paths(get_option('datadir'), 'glib-2.0/codegen')
 
-configure_file(input : 'config.py.in',
-  output : 'config.py',
-  install : true,
-  install_dir : codegen_dir,
-  configuration : gdbus_codegen_conf
-)
+gdbus_codegen_built_files = []
+gdbus_codegen_built_files += configure_file(input : 'config.py.in',
+                                            output : 'config.py',
+                                            install : true,
+                                            install_dir : codegen_dir,
+                                            configuration : gdbus_codegen_conf)
 
 blank_conf = configuration_data()
 foreach f : gdbus_codegen_files
   # Copy these into the builddir so that gdbus-codegen can be used uninstalled
   # and then install it too so that it can be used after installation
-  configure_file(input : f, output : f,
-    install : true,
-    install_dir : codegen_dir,
-    configuration : blank_conf)
+  gdbus_codegen_built_files += configure_file(input : f, output : f,
+                                              install : true,
+                                              install_dir : codegen_dir,
+                                              configuration : blank_conf)
 endforeach
diff --git a/gio/meson.build b/gio/meson.build
index 3252636..87f0861 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -174,6 +174,7 @@ xdp_dbus_generated = custom_target('xdp-dbus',
              'org.freedesktop.portal.NetworkMonitor.xml',
              'org.freedesktop.portal.ProxyResolver.xml'],
     output : ['xdp-dbus.h', 'xdp-dbus.c'],
+    depend_files : gdbus_codegen_built_files,
     command : [python, gdbus_codegen,
                '--interface-prefix', 'org.freedesktop.portal.',
                '--output-directory', '@OUTDIR@',
@@ -193,6 +194,7 @@ xdp_dbus_generated = custom_target('xdp-dbus',
 gdbus_daemon_generated = custom_target('gdbus-daemon-generated',
     input : ['dbus-daemon.xml'],
     output : ['gdbus-daemon-generated.h', 'gdbus-daemon-generated.c'],
+    depend_files : gdbus_codegen_built_files,
     command : [python, gdbus_codegen,
                '--interface-prefix', 'org.',
                '--output-directory', '@OUTDIR@',
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 2f74ce8..dd522a6 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -146,6 +146,7 @@ if host_machine.system() != 'windows'
         input :   ['test-codegen.xml'],
         output :  ['gdbus-test-codegen-generated.h',
                    'gdbus-test-codegen-generated.c'],
+        depend_files : gdbus_codegen_built_files,
         command : [python, gdbus_codegen,
                    '--interface-prefix', 'org.project.',
                    '--output-directory', '@OUTDIR@',


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