[vala/wip/meson: 5/6] meson: More vapi building



commit e650122fffdb12bead8f3c708bbcd0f0e1eca405
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Feb 13 22:32:12 2019 +0100

    meson: More vapi building

 meson_options.txt |  4 ++++
 vapi/meson.build  | 49 ++++++++++++++++++++++++++++++++++++-------------
 2 files changed, 40 insertions(+), 13 deletions(-)
---
diff --git a/meson_options.txt b/meson_options.txt
index 8522d0121..9909755d7 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -7,3 +7,7 @@ option('documentation', type: 'boolean', value: 'false',
        description : 'Build API reference and tools documentation')
 option('man-pages', type: 'boolean', value: 'false',
        description : 'Build man pages for installed tools')
+
+# Resource directories
+option('girdir', type: 'string', value: '',
+       description : 'Directory to use GIRs from')
diff --git a/vapi/meson.build b/vapi/meson.build
index 8baf4b4d5..cd9103cd8 100644
--- a/vapi/meson.build
+++ b/vapi/meson.build
@@ -358,7 +358,7 @@ gir_bindings = [
        ['gstreamer-allocators-1.0', 'GstAllocators-1.0', false, ['gstreamer-1.0', 'gstreamer-base-1.0']],
        ['gstreamer-app-1.0', 'GstApp-1.0', false, ['gstreamer-1.0', 'gstreamer-base-1.0']],
        ['gstreamer-audio-1.0', 'GstAudio-1.0', false, ['gstreamer-1.0', 'gstreamer-base-1.0']],
-       ['gstreamer-bad-allocators-1.0', 'GstBadAllocators-1.0', false, ['gstreamer-1.0', 
'gstreamer-base-1.0']],
+#      ['gstreamer-bad-allocators-1.0', 'GstBadAllocators-1.0', false, ['gstreamer-1.0', 
'gstreamer-base-1.0']],
        ['gstreamer-check-1.0', 'GstCheck-1.0', true, ['gstreamer-1.0', 'gstreamer-base-1.0']],
        ['gstreamer-controller-1.0', 'GstController-1.0', false, ['gstreamer-1.0', 'gstreamer-base-1.0']],
 #      ['gstreamer-fft-1.0', 'GstFft-1.0', true, ['gstreamer-1.0', 'gstreamer-base-1.0']],
@@ -375,30 +375,53 @@ gir_bindings = [
 #      ['gstreamer-rtsp-server-1.0', 'GstRtspServer-1.0', false, ['gstreamer-1.0', 'gstreamer-base-1.0', 
'gstreamer-rtsp-1.0']],
 ]
 
+vapigen_prog = find_program('vapigen', required: false)
+if not vapigen_prog.found()
+       vapigen_prog = vapigen_exe
+endif
+
 gobject_introspection_dep = dependency('gobject-introspection-1.0', required: false)
 girdir = gobject_introspection_dep.get_pkgconfig_variable('girdir')
+#girdir = get_options('girdir')
 
 metadatadir = join_paths(meson.current_source_dir(), 'metadata')
-vapigen_args = ['--metadatadir', metadatadir, '--vapidir', meson.current_source_dir()]
+vapigen_args = ['--metadatadir', metadatadir, '--directory', meson.current_source_dir(), '--vapidir', 
meson.current_source_dir()]
 
+girs = []
 foreach gir_vapi : gir_bindings
        pkg_args = []
        foreach pkg : gir_vapi[3]
                pkg_args += ['--pkg', pkg]
        endforeach
-       custom_target(gir_vapi[0],
-               output: '@0@.vapi'.format(gir_vapi[0]),
-               input: [
+       girs += custom_target(gir_vapi[0],
+               command: [
+                       vapigen_prog, '--library', gir_vapi[0], vapigen_args, pkg_args,
                        join_paths(girdir, '@0@.gir'.format(gir_vapi[1])),
                        gir_vapi[2] ? join_paths(metadatadir, '@0 -custom vala'.format(gir_vapi[1])) : [],
                ],
-               command: [vapigen_exe,
-                       '--library', gir_vapi[0],
-                       vapigen_args,
-                       pkg_args,
-                       '@INPUT@',
-               ],
-#              install: true,
-#              install_dir: join_paths(get_option('datadir'), 'vala@0@'.format(vala_version_suffix), 'vapi'),
+               output: gir_vapi[0],
        )
 endforeach
+
+girs_target = custom_target('gir-bindings',
+       command: [],
+       depends: girs,
+       output: 'gir-bindings',
+)
+
+gidls = []
+foreach gidl_vapi : gidl_bindings
+       #TODO
+endforeach
+
+gidls_target = custom_target('gidl-bindings',
+       command: [],
+       depends: gidls,
+       output: 'gidl-bindings',
+)
+
+all_target = custom_target('all-bindings',
+       command: [],
+       depends: [girs_target, gidls_target],
+       output: 'all-bindings',
+)


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