From 6955752b9593fc2e911aaa2d727161204b27f316 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 15 Dec 2025 15:23:23 +0200 Subject: [PATCH] doc: fix Meson warning about install_subdir ../../git/weston/doc/sphinx/meson.build:97: WARNING: Project targets '>= 0.63.0' but uses feature deprecated since '0.60.0': install_subdir with empty directory. It worked by accident and is buggy. Use install_emptydir instead. I get the above warning on a clean build, because the directory in question is empty at configure time. It gets populated at compile time. Having to exclude one file from the build complicated fixing this. custom_target() does not support install-excludes, and it looks like Sphinx does not allow locating the buildfile elsewhere. One option would be to use a meson.add_install_script() to delete the unwanted file after it has been installed, but this seemed more complicated than the solution I chose. The intermediate build directory name needs to change from 'doc' to 'weston', so that I don't need to strip_directory which custom_target does not support. The 'output' array in custom_target() also does not allow outputs to be speficied in sub-directories. The sh script is tidied up a little bit with set -e, otherwise it would have become unreadable. Signed-off-by: Pekka Paalanen --- doc/sphinx/meson.build | 13 ++++--------- doc/sphinx/run_doxygen_sphinx.sh.in | 13 ++++++++++++- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/doc/sphinx/meson.build b/doc/sphinx/meson.build index 87153a2bd..2d17be938 100644 --- a/doc/sphinx/meson.build +++ b/doc/sphinx/meson.build @@ -48,7 +48,7 @@ doxygen_conf_weston = configure_file( script_data = configuration_data() script_data.set('SRCDIR', meson.current_build_dir()) -script_data.set('OUTDIR', meson.current_build_dir() + '/doc') +script_data.set('OUTDIR', meson.current_build_dir() / 'weston') # Set a different directory for doctrees to avoid installing them script_data.set('DOCTREES_DIR', meson.current_build_dir() + '/doctrees') @@ -82,9 +82,11 @@ endif sphinx_doc = custom_target( 'weston-doc-breathe', command: script_doxy_sphinx, - output: 'doc', + output: 'weston', build_by_default: true, env: sphinx_env, + install: true, + install_dir: dir_data / 'doc', ) # we need this because we will have a stale 'doc' directory @@ -93,10 +95,3 @@ docs = run_target( 'docs', command: script_doxy_sphinx, ) - -install_subdir( - sphinx_doc.full_path(), - install_dir: dir_data / 'doc' / 'weston', - exclude_files: '.buildinfo', - strip_directory: true, -) diff --git a/doc/sphinx/run_doxygen_sphinx.sh.in b/doc/sphinx/run_doxygen_sphinx.sh.in index 1a28f0ab5..e1a1010c5 100755 --- a/doc/sphinx/run_doxygen_sphinx.sh.in +++ b/doc/sphinx/run_doxygen_sphinx.sh.in @@ -6,4 +6,15 @@ else SPHINX_WERROR="" fi -@DOXYGEN_CMD@ @DOXYGEN_CONF@ && @SPHINX_CMD@ $SPHINX_WERROR -E -q -j auto -d @DOCTREES_DIR@ @SRCDIR@ @OUTDIR@ +set -e + +BUILDINFO_ORIG="@OUTDIR@/.buildinfo" +BUILDINFO_SAVE="@SRCDIR@/buildinfo.save" + +[ -f "$BUILDINFO_SAVE" ] && mv -f "$BUILDINFO_SAVE" "$BUILDINFO_ORIG" + +@DOXYGEN_CMD@ @DOXYGEN_CONF@ + +@SPHINX_CMD@ $SPHINX_WERROR -E -q -j auto -d @DOCTREES_DIR@ @SRCDIR@ @OUTDIR@ + +mv -f "$BUILDINFO_ORIG" "$BUILDINFO_SAVE"