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 <jordan@embeint.com>
This commit is contained in:
Jordan Yates 2024-05-30 11:58:36 +10:00 committed by Carles Cufí
commit 2e99de8047
2 changed files with 2 additions and 4 deletions

View file

@ -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})

View file

@ -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.