meson.build: install symbolic links instead of compiling multiple times
Currently, among others, the `pipewire-pulse` executable is an exact copy of the `pipewire` executable. Use meson's `install_symlink()` to avoid the need for compiling the same thing multiple times. Also use `custom_target()` so that the aliases are available in an uninstalled environment. Do the same for `pw-cat`. The benefit is that all aliases of `pw-cat` are now available in an uninstalled environment. This commit increasese the minimum meson version to 0.61.1 as that is needed for `install_symlink()`. The reason for using 0.61.1 instead of 0.61.0 is the following bug: https://github.com/mesonbuild/meson/issues/9820
This commit is contained in:
parent
f3230ca2e6
commit
1ef43a5255
|
@ -1,7 +1,7 @@
|
|||
project('pipewire', ['c' ],
|
||||
version : '0.3.67',
|
||||
license : [ 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' ],
|
||||
meson_version : '>= 0.59.0',
|
||||
meson_version : '>= 0.61.1',
|
||||
default_options : [ 'warning_level=3',
|
||||
'c_std=gnu11',
|
||||
'cpp_std=c++17',
|
||||
|
|
|
@ -89,30 +89,7 @@ configure_file(input : 'pipewire.conf.in',
|
|||
pipewire_exec = executable('pipewire',
|
||||
pipewire_daemon_sources,
|
||||
install: true,
|
||||
c_args : pipewire_c_args,
|
||||
include_directories : [ configinc ],
|
||||
dependencies : [ spa_dep, pipewire_dep, ],
|
||||
)
|
||||
|
||||
executable('pipewire-pulse',
|
||||
pipewire_daemon_sources,
|
||||
install: true,
|
||||
c_args : pipewire_c_args,
|
||||
include_directories : [ configinc ],
|
||||
dependencies : [ spa_dep, pipewire_dep, ],
|
||||
)
|
||||
|
||||
executable('pipewire-avb',
|
||||
pipewire_daemon_sources,
|
||||
install: true,
|
||||
c_args : pipewire_c_args,
|
||||
include_directories : [ configinc ],
|
||||
dependencies : [ spa_dep, pipewire_dep, ],
|
||||
)
|
||||
|
||||
executable('pipewire-aes67',
|
||||
pipewire_daemon_sources,
|
||||
install: true,
|
||||
install_dir: pipewire_bindir,
|
||||
c_args : pipewire_c_args,
|
||||
include_directories : [ configinc ],
|
||||
dependencies : [ spa_dep, pipewire_dep, ],
|
||||
|
@ -120,6 +97,22 @@ executable('pipewire-aes67',
|
|||
|
||||
ln = find_program('ln')
|
||||
|
||||
foreach alias : ['pipewire-pulse', 'pipewire-avb', 'pipewire-aes67']
|
||||
custom_target(
|
||||
alias,
|
||||
build_by_default: true,
|
||||
install: false,
|
||||
command: [ln, '-sf', meson.project_build_root() + '/@INPUT@', '@OUTPUT@'],
|
||||
input: pipewire_exec,
|
||||
output: alias,
|
||||
)
|
||||
install_symlink(
|
||||
alias,
|
||||
pointing_to: pipewire_exec.name(),
|
||||
install_dir: pipewire_bindir,
|
||||
)
|
||||
endforeach
|
||||
|
||||
custom_target('pipewire-uninstalled',
|
||||
build_by_default: true,
|
||||
install: false,
|
||||
|
|
|
@ -58,16 +58,26 @@ if get_option('pw-cat').allowed() and sndfile_dep.found()
|
|||
'pw-encplay',
|
||||
]
|
||||
|
||||
executable('pw-cat',
|
||||
pw_cat = executable('pw-cat',
|
||||
pwcat_sources,
|
||||
install: true,
|
||||
dependencies : [pwcat_deps, pipewire_dep, mathlib],
|
||||
)
|
||||
|
||||
foreach alias : pwcat_aliases
|
||||
dst = pipewire_bindir / alias
|
||||
cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pw-cat', dst)
|
||||
meson.add_install_script('sh', '-c', cmd)
|
||||
custom_target(
|
||||
alias,
|
||||
build_by_default: true,
|
||||
install: false,
|
||||
command: [ln, '-sf', meson.project_build_root() + '/@INPUT@', '@OUTPUT@'],
|
||||
input: pw_cat,
|
||||
output: alias,
|
||||
)
|
||||
install_symlink(
|
||||
alias,
|
||||
pointing_to: pw_cat.name(),
|
||||
install_dir: pipewire_bindir,
|
||||
)
|
||||
endforeach
|
||||
elif not sndfile_dep.found() and get_option('pw-cat').enabled()
|
||||
error('pw-cat is enabled but required dependency `sndfile` was not found.')
|
||||
|
|
Loading…
Reference in New Issue