Skip to content

Commit b9fcc41

Browse files
marc-hblgirdwood
authored andcommitted
xtensa-build-zephyr: fix incremental build, pass CMAKE_ARGS only once
As documented in https://docs.zephyrproject.org/latest/guides/west/build-flash-debug.html#one-time-cmake-arguments and accidentally found when testing rimage cleanup zephyrproject-rtos/zephyr#40431 Fixes commit 88327f6 ("xtensa-build-zephyr: support passing through CMake arguments"); ccache is too good and hid this regression from me. Signed-off-by: Marc Herbert <[email protected]>
1 parent d4b8a01 commit b9fcc41

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

scripts/xtensa-build-zephyr.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,21 @@ build_platforms()
241241
# west can get lost in symbolic links and then
242242
# show a confusing error.
243243
/bin/pwd
244-
set -x
245-
west build --build-dir "$bdir" --board "$PLAT_CONFIG" \
244+
if test -d "$bdir"; then
245+
test -z "${CMAKE_ARGS+defined}" ||
246+
die 'Cannot re-define CMAKE_ARGS, you must delete %s first\n' \
247+
"$(pwd)/$bdir"
248+
# --board is cached and not required again either but unlike
249+
# CMAKE_ARGS this _not_ does force CMake to re-run and passing
250+
# a different board by mistake is very nicely caught by west.
251+
set -x
252+
west build --build-dir "$bdir" --board "$PLAT_CONFIG"
253+
else
254+
set -x
255+
west build --build-dir "$bdir" --board "$PLAT_CONFIG" \
246256
zephyr/samples/subsys/audio/sof \
247257
-- "${CMAKE_ARGS[@]}"
258+
fi
248259

249260
# This should ideally be part of
250261
# sof/zephyr/CMakeLists.txt but due to the way

0 commit comments

Comments
 (0)