xtensa-build-zephyr: de-dup. first vs incremental west invocation

Passing spurious --board and source directory arguments to an already
build directory does not help but it does not hurt either and it
simplifies the code. It also provides a more consistent west command in
the set -x "logs", one that can be re-used in any circumstance.

The only restriction is to make sure CMAKE_ARGS is empty on all but the
first invocation but that's not new and unchanged here.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2022-01-13 19:02:10 +00:00 committed by Liam Girdwood
parent 12f4834e40
commit ac1a09afdb
1 changed files with 3 additions and 9 deletions

View File

@ -250,17 +250,11 @@ build_platforms()
test -z "${CMAKE_ARGS+defined}" || test -z "${CMAKE_ARGS+defined}" ||
die 'Cannot re-define CMAKE_ARGS, you must delete %s first\n' \ die 'Cannot re-define CMAKE_ARGS, you must delete %s first\n' \
"$(pwd)/$bdir" "$(pwd)/$bdir"
# --board is cached and not required again either but unlike fi
# CMAKE_ARGS this _not_ does force CMake to re-run and passing
# a different board by mistake is very nicely caught by west.
set -x
west $verbose build --build-dir "$bdir" --board "$PLAT_CONFIG"
else
set -x set -x
west $verbose build --build-dir "$bdir" --board "$PLAT_CONFIG" \ west $verbose build --build-dir "$bdir" --board "$PLAT_CONFIG" \
zephyr/samples/subsys/audio/sof \ zephyr/samples/subsys/audio/sof \
-- "${CMAKE_ARGS[@]}" -- "${CMAKE_ARGS[@]}"
fi
# This should ideally be part of # This should ideally be part of
# sof/zephyr/CMakeLists.txt but due to the way # sof/zephyr/CMakeLists.txt but due to the way