Files
glib/gio/gdbus-2.0/codegen/meson.build
Nirbheek Chauhan 02763e0d19 meson: Provide our Python tools for builds
Several of our tools are installed and are used by other projects to
generate code. However, there is no 'install' when projects use glib
as a subproject, so we needed some way for glib to 'provide' these
tools.

Starting from Meson 0.46, this can be done with the
meson.override_find_program() function. This also means that we can
use these tools ourselves via the GNOME module and don't need to
manually create command-lines.
2018-05-17 13:19:22 +05:30

45 lines
1.6 KiB
Meson

gdbus_codegen_files = [
'__init__.py',
'codegen.py',
'codegen_main.py',
'codegen_docbook.py',
'dbustypes.py',
'parser.py',
'utils.py',
]
gdbus_codegen_conf = configuration_data()
gdbus_codegen_conf.set('VERSION', glib_version)
gdbus_codegen_conf.set('PYTHON', python.path())
gdbus_codegen_conf.set('DATADIR', glib_datadir)
# Install gdbus-codegen executable
gdbus_codegen = configure_file(input : 'gdbus-codegen.in',
output : 'gdbus-codegen',
install : true,
install_dir : get_option('bindir'),
configuration : gdbus_codegen_conf
)
# Provide gdbus-codegen for us (GNOME module)
# and for others when we're a subproject
meson.override_find_program('gdbus-codegen', gdbus_codegen)
codegen_dir = join_paths(get_option('datadir'), 'glib-2.0/codegen')
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
gdbus_codegen_built_files += configure_file(input : f, output : f,
install : true,
install_dir : codegen_dir,
configuration : blank_conf)
endforeach