meson.build: add devenv

meson devenv provides a convenient way of running the application
without installing it by overriding certain environment variables.
meson automatically overrides PATH and LD_LIBRARY_PATH, thus
there is no need to manually set those.

Running `meson devenv -C <builddir>` opens a new shell in the
build directory with the environment variables set up.
This commit is contained in:
Barnabás Pőcze 2021-12-15 14:11:58 +01:00 committed by George Kiagiadakis
parent f8d60fcecd
commit 0ff9ea9f33

View file

@ -138,3 +138,16 @@ wireplumber_uninstalled = custom_target('wp-uninstalled',
build_by_default : true,
command : ['cp', '@INPUT@', '@OUTPUT@'],
)
if meson.version().version_compare('>= 0.58')
builddir = meson.project_build_root()
srcdir = meson.project_source_root()
devenv = environment({
'WIREPLUMBER_MODULE_DIR': builddir / 'modules',
'WIREPLUMBER_CONFIG_DIR': srcdir / 'src' / 'config',
'WIREPLUMBER_DATA_DIR': srcdir / 'src',
})
meson.add_devenv(devenv)
endif