Commit 1829dc88 authored by Gerard Marull-Paretas's avatar Gerard Marull-Paretas Committed by Christopher Friedt
Browse files

doc: do not use env vars to discover paths


ZEPHYR_BASE and ZEPHYR_BUILD directories were passed to Sphinx via
environment variables. However, these paths can be easily discovered by
the conf.py file itself. As a result, Sphinx is less dependent on CMake
to operate.
Signed-off-by: default avatarGerard Marull-Paretas <gerard.marull@nordicsemi.no>
parent abda02ff
......@@ -45,8 +45,6 @@ find_program(WEST west)
# Environment & Paths
set(SPHINX_ENV
ZEPHYR_BASE=${ZEPHYR_BASE}
ZEPHYR_BUILD=${CMAKE_CURRENT_BINARY_DIR}
DOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE}
DOT_EXECUTABLE=${DOXYGEN_DOT_EXECUTABLE}
)
......
......@@ -6,18 +6,13 @@ import os
from pathlib import Path
import re
from sphinx.cmd.build import get_parser
import sphinx_rtd_theme
ZEPHYR_BASE = os.environ.get("ZEPHYR_BASE")
if not ZEPHYR_BASE:
raise ValueError("ZEPHYR_BASE environment variable undefined")
ZEPHYR_BASE = Path(ZEPHYR_BASE)
ZEPHYR_BUILD = os.environ.get("ZEPHYR_BUILD")
if not ZEPHYR_BUILD:
raise ValueError("ZEPHYR_BUILD environment variable undefined")
ZEPHYR_BUILD = Path(ZEPHYR_BUILD)
args = get_parser().parse_args()
ZEPHYR_BASE = Path(__file__).resolve().parents[1]
ZEPHYR_BUILD = Path(args.outputdir).resolve()
# Add the '_extensions' directory to sys.path, to enable finding Sphinx
# extensions within.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment