From f113eb4b71218403ec99b956591f5309144804ca Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Mon, 24 Jan 2022 14:12:22 +0800 Subject: [PATCH] [script] support cmake-build in different dir (#7344) This commit allows calling this cmake-build script from a different directory. Currently it only supports root of OpenThread source. --- script/cmake-build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/cmake-build b/script/cmake-build index d3ccf0d41..b91b7be09 100755 --- a/script/cmake-build +++ b/script/cmake-build @@ -63,7 +63,9 @@ set -euxo pipefail OT_CMAKE_NINJA_TARGET=${OT_CMAKE_NINJA_TARGET:-} -readonly OT_SRCDIR="$(pwd)" +OT_SRCDIR="$(cd "$(dirname "$0")"/.. && pwd)" + +readonly OT_SRCDIR readonly OT_PLATFORMS=(cc2538 simulation posix) readonly OT_POSIX_SIM_COMMON_OPTIONS=( "-DOT_ANYCAST_LOCATOR=ON"