Skip to content

Commit 35cef21

Browse files
committed
Arm backend: Make build script source the generated setup_path.sh
This makes it more easy to run the scripts from various tools like your editor. Signed-off-by: Zingo Andersen <[email protected]> Change-Id: I9be8781587f8b75b1f11d24ad4aa9dc1c185b310
1 parent 5344a1a commit 35cef21

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

backends/arm/scripts/build_executorch.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ et_root_dir=$(cd ${script_dir}/../../.. && pwd)
1515
et_root_dir=$(realpath ${et_root_dir})
1616
toolchain_cmake=${script_dir}/../../../examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
1717
toolchain_cmake=$(realpath ${toolchain_cmake})
18+
setup_path_script=${et_root_dir}/examples/arm/ethos-u-scratch/setup_path.sh
19+
_setup_msg="please refer to ${et_root_dir}/examples/arm/setup.sh to properly install necessary tools."
1820

1921
et_build_root="${et_root_dir}/arm_test"
2022
build_type="Release"
@@ -43,6 +45,13 @@ for arg in "$@"; do
4345
esac
4446
done
4547

48+
# Source the tools
49+
# This should be prepared by the setup.sh
50+
[[ -f ${setup_path_script} ]] \
51+
|| { echo "Missing ${setup_path_script}. ${_setup_msg}"; exit 1; }
52+
53+
source ${setup_path_script}
54+
4655
et_build_dir="${et_build_root}/cmake-out"
4756

4857
# Used for flatcc host excutable if Devtools is used

backends/arm/scripts/build_executorch_runner.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
1010
et_root_dir=$(cd ${script_dir}/../../.. && pwd)
1111
et_root_dir=$(realpath ${et_root_dir})
1212
toolchain_cmake=${et_root_dir}/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
13+
setup_path_script=${et_root_dir}/examples/arm/ethos-u-scratch/setup_path.sh
14+
_setup_msg="please refer to ${et_root_dir}/examples/arm/setup.sh to properly install necessary tools."
1315

1416
pte_file=""
1517
target="ethos-u55-128"
@@ -66,6 +68,13 @@ for arg in "$@"; do
6668
esac
6769
done
6870

71+
# Source the tools
72+
# This should be prepared by the setup.sh
73+
[[ -f ${setup_path_script} ]] \
74+
|| { echo "Missing ${setup_path_script}. ${_setup_msg}"; exit 1; }
75+
76+
source ${setup_path_script}
77+
6978
pte_file=$(realpath ${pte_file})
7079
ethosu_tools_dir=$(realpath ${ethosu_tools_dir})
7180
ethos_u_root_dir="$ethosu_tools_dir/ethos-u"

backends/arm/scripts/build_portable_kernels.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ et_root_dir=$(cd ${script_dir}/../../.. && pwd)
1515
et_root_dir=$(realpath ${et_root_dir})
1616
toolchain_cmake=${script_dir}/../../../examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
1717
toolchain_cmake=$(realpath ${toolchain_cmake})
18+
setup_path_script=${et_root_dir}/examples/arm/ethos-u-scratch/setup_path.sh
19+
_setup_msg="please refer to ${et_root_dir}/examples/arm/setup.sh to properly install necessary tools."
1820

1921

2022
et_build_root="${et_root_dir}/arm_test"
@@ -41,6 +43,13 @@ for arg in "$@"; do
4143
esac
4244
done
4345

46+
# Source the tools
47+
# This should be prepared by the setup.sh
48+
[[ -f ${setup_path_script} ]] \
49+
|| { echo "Missing ${setup_path_script}. ${_setup_msg}"; exit 1; }
50+
51+
source ${setup_path_script}
52+
4453
et_build_dir=${et_build_root}/cmake-out
4554

4655
cd "${et_root_dir}"

0 commit comments

Comments
 (0)