From 5694cfa01234dee8f9e8f311f27cf7a6bf2f9454 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 20 Sep 2022 17:48:53 +0000 Subject: [PATCH] scripts: add link to CMake envvars FAQ next to XTENSA_SYSTEM definition Environment variables like XTENSA_SYSTEM are an absolute CMake pain. Add a link to the CMake FAQ and a one-line description why. Signed-off-by: Marc Herbert --- scripts/xtensa-build-all.sh | 2 ++ scripts/xtensa-build-zephyr.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/xtensa-build-all.sh b/scripts/xtensa-build-all.sh index 981ad81ff..f12bf197b 100755 --- a/scripts/xtensa-build-all.sh +++ b/scripts/xtensa-build-all.sh @@ -392,6 +392,8 @@ do then TOOLCHAIN=xt ROOT="$XTENSA_BUILDS_DIR/$XTENSA_CORE/xtensa-elf" + # CMake cannot set (evil) build-time environment variables at configure time: +# https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#how-can-i-get-or-set-environment-variables export XTENSA_SYSTEM=$XTENSA_BUILDS_DIR/$XTENSA_CORE/config printf 'XTENSA_SYSTEM=%s\n' "${XTENSA_SYSTEM}" PATH=$XTENSA_TOOLS_DIR/XtensaTools/bin:$OLDPATH diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index 992491987..256158e2f 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -464,7 +464,9 @@ def build_platforms(): print(f"XTENSA_TOOLCHAIN_PATH={XTENSA_TOOLCHAIN_PATH}") print(f"TOOLCHAIN_VER={TOOLCHAIN_VER}") - # set variables expected by xcc toolchain + # Set variables expected by xcc toolchain. CMake cannot set (evil) build-time + # environment variables at configure time: + # https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#how-can-i-get-or-set-environment-variables XTENSA_BUILDS_DIR=str(pathlib.Path(xtensa_tools_root_dir, "install", "builds", TOOLCHAIN_VER).absolute()) XTENSA_SYSTEM = str(pathlib.Path(XTENSA_BUILDS_DIR, XTENSA_CORE, "config").absolute())