From 2e99de80472b80f36303ff85c8ed5d54dfe73ef4 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Thu, 30 May 2024 11:58:36 +1000 Subject: [PATCH] doc: conf.py: build directory from environment Get the output directory from environment variables instead of attempting to reparse the CLI arguments, as these can actually refer to a program other than `sphinx-build` (for example `sphinx-autobuild`). Signed-off-by: Jordan Yates --- doc/CMakeLists.txt | 1 + doc/conf.py | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 4a9861f7a1d..826376cc3aa 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -45,6 +45,7 @@ endif() set(SPHINX_ENV DOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} DOT_EXECUTABLE=${DOXYGEN_DOT_EXECUTABLE} + DOCS_HTML_DIR=${CMAKE_CURRENT_BINARY_DIR}/html ) if(DEFINED ENV{ZEPHYR_DOXYGEN_OVERLAY}) diff --git a/doc/conf.py b/doc/conf.py index fdfdc2c71fe..5b0f2959261 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -7,11 +7,8 @@ from pathlib import Path import re import textwrap -from sphinx.cmd.build import get_parser - -args = get_parser().parse_args() ZEPHYR_BASE = Path(__file__).resolve().parents[1] -ZEPHYR_BUILD = Path(args.outputdir).resolve() +ZEPHYR_BUILD = Path(os.environ.get("DOCS_HTML_DIR")).resolve() # Add the '_extensions' directory to sys.path, to enable finding Sphinx # extensions within.