Skip to content

Commit

Permalink
[microTVM] Zephyr: implement 'west_cmd' server option (apache#8941)
Browse files Browse the repository at this point in the history
Currently Zephyr Project API server lists option 'west_cmd' as an
option available in Zephyr platform by advertising it in PROJECT_OPTIONS
but that option is not used by any API method.

That commit adds that option to the server as a non-required option to
the build() interface method, allowing the user to specify an
alternative path to the west tool. If that option is not specified the
Zephyr build system takes care of searching for west as a module (so
relying on West being available on Python, i.e. relying on
'python3 -m west').

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
  • Loading branch information
gromero authored and ylc committed Jan 13, 2022
1 parent b646ba2 commit 142cfc7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/microtvm/zephyr/template_project/microtvm_api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@ def build(self, options):
if options.get("zephyr_base"):
cmake_args.append(f"-DZEPHYR_BASE:STRING={options['zephyr_base']}")

if options.get("west_cmd"):
cmake_args.append(f"-DWEST={options['west_cmd']}")

cmake_args.append(f"-DBOARD:STRING={options['zephyr_board']}")

check_call(cmake_args, cwd=BUILD_DIR)
Expand Down

0 comments on commit 142cfc7

Please sign in to comment.