summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2019-01-07 17:44:09 +0100
committerOndrej Holy <oholy@redhat.com>2019-01-07 17:44:09 +0100
commit7a2ff5035bf6cce3c783224c9df800c4a59a1f8f (patch)
tree46017945914ab9e69467f12a69bb5ee7180ef07d
parent47203abf0b087be1fbf936d4040291e97fe39e16 (diff)
downloadgvfs-7a2ff5035bf6cce3c783224c9df800c4a59a1f8f.tar.gz
Revert "build: Remove gdbus codegen workaround"
This reverts commit 32bde011b2522d302d72506884866bd809ef5bda.
-rwxr-xr-xcodegen.py28
-rw-r--r--common/meson.build16
-rw-r--r--meson.build6
-rw-r--r--metadata/meson.build16
4 files changed, 54 insertions, 12 deletions
diff --git a/codegen.py b/codegen.py
new file mode 100755
index 00000000..9bc379ce
--- /dev/null
+++ b/codegen.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+
+'''
+FIXME
+
+This script is used only to call gdbus-codegen and simulate the
+generation of the source code and header as different targets.
+
+Both are generated implicitly, so meson is not able to know how
+many files are generated, so it does generate only one opaque
+target that represents the two files.
+
+Please see:
+ https://bugzilla.gnome.org/show_bug.cgi?id=791015
+ https://github.com/mesonbuild/meson/pull/2930
+'''
+
+import subprocess
+import sys
+
+subprocess.call([
+ 'gdbus-codegen',
+ '--interface-prefix=' + sys.argv[1],
+ '--generate-c-code=' + sys.argv[2],
+ '--c-namespace=' + sys.argv[3],
+ '--output-directory=' + sys.argv[4],
+ sys.argv[5]
+])
diff --git a/common/meson.build b/common/meson.build
index beef8c26..a718783f 100644
--- a/common/meson.build
+++ b/common/meson.build
@@ -14,12 +14,16 @@ sources = files(
'gvfsutils.c',
)
-dbus_sources = gnome.gdbus_codegen(
- 'gvfsdbus',
- gvfs_namespace + '.xml',
- interface_prefix: gvfs_namespace + '.',
- namespace: 'GVfsDBus',
- autocleanup: 'objects',
+# FIXME: Ugly workaround that simulates the generation of
+# two different targets.
+namespace = 'GVfsDBus'
+name = namespace.to_lower()
+
+dbus_sources = custom_target(
+ name,
+ input: gvfs_namespace + '.xml',
+ output: [name + '.c', name + '.h'],
+ command: [codegen, gvfs_namespace + '.', name, namespace, meson.current_build_dir(), '@INPUT@', '@OUTPUT@'],
)
deps = [
diff --git a/meson.build b/meson.build
index 43e126c0..19e91c3a 100644
--- a/meson.build
+++ b/meson.build
@@ -453,6 +453,12 @@ endif
enable_devel_utils = get_option('devel_utils')
enable_installed_tests = get_option('installed_tests')
+# FIXME: Opaque target return from gdbus_codegen
+# Please see:
+# https://bugzilla.gnome.org/show_bug.cgi?id=791015
+# https://github.com/mesonbuild/meson/pull/2930
+codegen = find_program('codegen.py')
+
gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
diff --git a/metadata/meson.build b/metadata/meson.build
index e51f1564..bbfd09fd 100644
--- a/metadata/meson.build
+++ b/metadata/meson.build
@@ -29,12 +29,16 @@ metadata_service = configure_file(
install_dir: dbus_session_bus_services_dir,
)
-dbus_sources = gnome.gdbus_codegen(
- 'metadata-dbus',
- 'dbus-interface.xml',
- interface_prefix: gvfs_namespace + '.',
- namespace: 'GVfs',
- autocleanup: 'objects',
+# FIXME: Ugly workaround that simulates the generation of
+# two different targets.
+namespace = 'GVfs'
+name = 'metadata-dbus'
+
+dbus_sources = custom_target(
+ name,
+ input: 'dbus-interface.xml',
+ output: [name + '.c', name + '.h'],
+ command: [codegen, gvfs_namespace + '.', name, namespace, meson.current_build_dir(), '@INPUT@', '@OUTPUT@'],
)
sources = files(