diff options
author | Thomas Weißschuh <thomas@t-8ch.de> | 2023-01-05 23:28:16 +0000 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-01-08 01:55:40 +0000 |
commit | 8a0fa62b5845fb512c2608580da65564270da1ce (patch) | |
tree | f89d1c84b41d6fa07b09ff640f288ff247c6cac4 /meson.build | |
parent | c8a90001f237b8b0393638c7846000d0c3ee93b8 (diff) | |
download | mpv-8a0fa62b5845fb512c2608580da65564270da1ce.tar.bz2 mpv-8a0fa62b5845fb512c2608580da65564270da1ce.tar.xz |
meson: dynamically compute dependencies for manpage and html build
This allows us to rebuild the manpages and html documentation only when
necessary. It is not necessary to manually keep the list of dependencies
up to date.
Unfortunately rst2pdf does not yet support this feature, see
https://github.com/rst2pdf/rst2pdf/issues/1108
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/meson.build b/meson.build index 5c6439d2f7..6b8e264c25 100644 --- a/meson.build +++ b/meson.build @@ -554,6 +554,7 @@ tools_directory = join_paths(source_root, 'TOOLS') file2string = find_program(join_paths(tools_directory, 'file2string.py')) matroska = find_program(join_paths(tools_directory, 'matroska.py')) version_py = find_program(join_paths(source_root, 'version.py')) +docutils_wrapper = find_program(join_paths(tools_directory, 'docutils-wrapper.py')) subdir('generated') subdir(join_paths('generated', 'etc')) @@ -1556,7 +1557,12 @@ if features['manpage-build'] custom_target('manpages', input: manpage, output: 'mpv.1', - command: [rst2man, '--strip-elements-with-class=contents', '@INPUT@', '@OUTPUT@'], + command: [ + docutils_wrapper, rst2man, + '--record-dependencies', '@DEPFILE@', + '--strip-elements-with-class=contents', + '@INPUT@', '@OUTPUT@'], + depfile: 'mpv.1.dep', install: true, install_dir: join_paths(mandir, 'man1') ) @@ -1569,7 +1575,11 @@ if features['html-build'] custom_target('html-manpages', input: manpage, output: 'mpv.html', - command: [rst2html, '@INPUT@', '@OUTPUT@'], + command: [ + docutils_wrapper, rst2html, + '--record-dependencies', '@DEPFILE@', + '@INPUT@', '@OUTPUT@'], + depfile: 'mpv.html.dep', install: true, install_dir: join_paths(datadir, 'doc', 'mpv') ) |