mirror of
https://github.com/espressif/openthread.git
synced 2026-08-15 07:07:46 +00:00
[cmake-build] allow specify multiple targets (#8264)
This commit allows using OT_CMAKE_NINJA_TARGET to specify multiple targets.
This commit is contained in:
+5
-4
@@ -45,6 +45,7 @@
|
||||
# Compile with the specified ninja build target:
|
||||
#
|
||||
# OT_CMAKE_NINJA_TARGET="ot-cli-ftd" script/cmake-build ${platform}
|
||||
# OT_CMAKE_NINJA_TARGET="ot-cli-ftd ot-cli-mtd" script/cmake-build ${platform}
|
||||
#
|
||||
# Compile with the specified build directory:
|
||||
#
|
||||
@@ -122,11 +123,11 @@ build()
|
||||
cd "${builddir}"
|
||||
|
||||
cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DOT_COMPILE_WARNING_AS_ERROR=ON "$@" "${OT_SRCDIR}"
|
||||
|
||||
if [[ -n ${OT_CMAKE_NINJA_TARGET[*]} ]]; then
|
||||
ninja "${OT_CMAKE_NINJA_TARGET[@]}"
|
||||
else
|
||||
if [[ -z ${OT_CMAKE_NINJA_TARGET// /} ]]; then
|
||||
ninja
|
||||
else
|
||||
IFS=' ' read -r -a OT_CMAKE_NINJA_TARGET <<<"${OT_CMAKE_NINJA_TARGET}"
|
||||
ninja "${OT_CMAKE_NINJA_TARGET[@]}"
|
||||
fi
|
||||
|
||||
cd "${OT_SRCDIR}"
|
||||
|
||||
Reference in New Issue
Block a user