mirror of
https://gitlab.freedesktop.org/pipewire/media-session.git
synced 2025-12-20 04:10:02 +01:00
media-session-uninstalled: build this script with the meson dirs filled in
This matches WirePlumber commit 52aaf9617 ./builddir/media-session-uninstalled.sh can now be called without a -b argument, it'll automatically set the full paths. This is useful when building as a subproject. meson has a limitation: the configure_file() object is just a file wrapper object. Wrap this into a custom_target() whose return value has a full_path() method. This way, pipewire can use media_session_uninstalled.full_path() without having to build the directory structure itself.
This commit is contained in:
parent
b3b43f4ae2
commit
327f9159be
2 changed files with 28 additions and 8 deletions
|
|
@ -2,7 +2,15 @@
|
|||
|
||||
set -e
|
||||
|
||||
SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
# This is unset by meson
|
||||
# shellcheck disable=SC2157
|
||||
if [ -z "@MESON@" ]; then
|
||||
SOURCEDIR="@MESON_SOURCE_ROOT@"
|
||||
BUILDDIR="@MESON_BUILD_ROOT@"
|
||||
else
|
||||
SOURCEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
BUILDDIR=${SOURCEDIR}/builddir
|
||||
fi
|
||||
|
||||
while getopts ":b:v:" opt; do
|
||||
case ${opt} in
|
||||
|
|
@ -24,11 +32,6 @@ while getopts ":b:v:" opt; do
|
|||
esac
|
||||
done
|
||||
|
||||
if [ -z "${BUILDDIR}" ]; then
|
||||
BUILDDIR=${SOURCEDIR}/builddir
|
||||
echo "Using default build directory: ${BUILDDIR}"
|
||||
fi
|
||||
|
||||
if [ ! -d "${BUILDDIR}" ]; then
|
||||
echo "Invalid build directory: ${BUILDDIR}"
|
||||
exit 1
|
||||
|
|
|
|||
21
meson.build
21
meson.build
|
|
@ -121,9 +121,26 @@ if doxygen.found()
|
|||
subdir('doc')
|
||||
endif
|
||||
|
||||
setenv = find_program('media-session-uninstalled.sh')
|
||||
conf_uninstalled = configuration_data()
|
||||
conf_uninstalled.set('MESON', '')
|
||||
conf_uninstalled.set('MESON_SOURCE_ROOT', meson.project_source_root())
|
||||
conf_uninstalled.set('MESON_BUILD_ROOT', meson.project_build_root())
|
||||
|
||||
ms_uninstalled = configure_file(
|
||||
input : 'media-session-uninstalled.sh',
|
||||
output : 'media-session-uninstalled.sh.in',
|
||||
configuration : conf_uninstalled,
|
||||
)
|
||||
|
||||
media_session_uninstalled = custom_target('media-session-uninstalled',
|
||||
output : 'media-session-uninstalled.sh',
|
||||
input : ms_uninstalled,
|
||||
build_by_default : true,
|
||||
command : ['cp', '@INPUT@', '@OUTPUT@'],
|
||||
)
|
||||
|
||||
run_target('media-session-uninstalled',
|
||||
command : [setenv,
|
||||
command : [media_session_uninstalled,
|
||||
'-b@0@'.format(meson.project_build_root()),
|
||||
'-v@0@'.format(media_session_version)]
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue