mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-25 11:30:29 +00:00
meson: Only rebuild when files checked in git change
This allows for faster rebuild avoiding to run the target when nothing changed. This approach is not ideal as we should find a way to actually know when to rebuild based on information from cargo itself but there seem to be no way to do it at this point.
This commit is contained in:
parent
f78b97ba4a
commit
3cc2b32756
1 changed files with 12 additions and 2 deletions
14
meson.build
14
meson.build
|
@ -176,14 +176,24 @@ extra_env_str = ','.join(extra_env_list)
|
|||
plugins_install_dir = get_option('libdir') / 'gstreamer-1.0'
|
||||
pkgconfig_install_dir = get_option('libdir') / 'pkgconfig'
|
||||
|
||||
# Always build the target so we don't have to list all source files as input
|
||||
# Use all files checked in git to figure out when to rebuild
|
||||
tmp = run_command(['git', 'ls-files', '.'])
|
||||
files = tmp.stdout().split()
|
||||
if tmp.returncode() == 0 and files.length() > 0
|
||||
build_always_stale = false
|
||||
else
|
||||
warning('Could not retrieve list of files, always building the target')
|
||||
build_always_stale = true
|
||||
endif
|
||||
|
||||
rs_plugins = custom_target('gst-plugins-rs',
|
||||
build_by_default: true,
|
||||
output: output,
|
||||
console: true,
|
||||
install: true,
|
||||
install_dir: plugins_install_dir,
|
||||
build_always_stale: true,
|
||||
input: files,
|
||||
build_always_stale: build_always_stale,
|
||||
depends: depends,
|
||||
command: [cargo_wrapper,
|
||||
'build',
|
||||
|
|
Loading…
Reference in a new issue