]> www.infradead.org Git - qemu-nvme.git/commitdiff
meson.build: Make manuals depend on source to Sphinx extensions
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 25 Sep 2020 16:23:09 +0000 (17:23 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 29 Sep 2020 15:55:39 +0000 (17:55 +0200)
The automatic dependency handling for Sphinx manuals only makes the output
depend on the input documentation files. This means that if you edit
the Python source of an extension then the documentation won't be
rebuilt.

Create a list of all the source files for the extensions and add
it to the dependencies for the manuals. This is similar to how we
handle the qapi_gen_depends list.

Because we don't try to identify which manuals are using which
Sphinx extensions, a change to the source of one extension will
always rebuild the entire manual set, not merely the manuals
which have changed. This is acceptable because we don't change
the extensions all that often.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20200925162316.21205-15-peter.maydell@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Re rebuilding the enitre manual set being acceptable "because we
don't change the extensions all that often": we also rebuild it when
the QAPI generator code the qapidoc extension depends on changes.
This will inconvenience QAPI developers.  Can't be helped now.]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
docs/meson.build
meson.build

index 52e384be1777c7e0bb4108e359ba7a9797aff74c..0340d489acdd36e1b2598da464e8433dc7fe37de 100644 (file)
@@ -36,6 +36,7 @@ if build_docs
                 output: [manual + '.stamp'],
                 input: [files('conf.py'), files(manual / 'conf.py')],
                 depfile: manual + '.d',
+                depend_files: sphinx_extn_depends,
                 command: [SPHINX_ARGS, '-Ddepfile=@DEPFILE@',
                           '-Ddepfile_stamp=@OUTPUT0@',
                           '-b', 'html', '-d', private_dir,
index 866321462e0ace9177c5e4f7fede48b42952bb2f..6cb8aebd7d6240c418830e7d38af39e1634c6922 100644 (file)
@@ -680,6 +680,14 @@ if get_option('werror')
   SPHINX_ARGS += [ '-W' ]
 endif
 
+sphinx_extn_depends = [ meson.source_root() / 'docs/sphinx/depfile.py',
+                        meson.source_root() / 'docs/sphinx/hxtool.py',
+                        meson.source_root() / 'docs/sphinx/kerneldoc.py',
+                        meson.source_root() / 'docs/sphinx/kernellog.py',
+                        meson.source_root() / 'docs/sphinx/qapidoc.py',
+                        meson.source_root() / 'docs/sphinx/qmp_lexer.py',
+                        qapi_gen_depends ]
+
 # Collect sourcesets.
 
 util_ss = ss.source_set()