Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[µTVM] Zephyr: Fix missing board-specific config file in build dir #8230

Merged
merged 1 commit into from
Jun 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions python/tvm/micro/contrib/zephyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@ def library(self, output, sources, options=None):
project_dir_conf = os.path.join(self._project_dir, "prj.conf")
if os.path.exists(project_dir_conf):
shutil.copy(project_dir_conf, lib_prj_conf)

# Copy board-specific Zephyr config file from the project_dir to
# the build lib dir so board-specific configs can be found and used by
# Zephyr's build system in conjunction with the generic prj.conf configs.
board_conf = os.path.join("boards", self._board + ".conf")
project_dir_board_conf = os.path.join(self._project_dir, board_conf)
if os.path.exists(project_dir_board_conf):
os.mkdir(os.path.join(output, "boards"))
lib_dir_board_conf = os.path.join(output, board_conf)
shutil.copy(project_dir_board_conf, lib_dir_board_conf)

else:
with open(lib_prj_conf, "w") as prj_conf_f:
prj_conf_f.write("CONFIG_CPLUSPLUS=y\n")
Expand Down