summaryrefslogtreecommitdiff
path: root/zephyr/zmake/zmake/zmake.py
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2023-03-04 17:05:56 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-07 18:53:50 +0000
commit0dec34585249d824a0bb5a355d8588f2a6e67558 (patch)
treedecda66fdf32412c80e3af31fd23b1740533796d /zephyr/zmake/zmake/zmake.py
parent5bd2330edf2e523881b27427b2303407baaf1b65 (diff)
downloadchrome-ec-0dec34585249d824a0bb5a355d8588f2a6e67558.tar.gz
zephyr: Support building projects outside of platform/ec/zephyr
By default, zmake searches for projects defined in platform/ec/zephyr. However, the chameleon project is defined in another repository. Add a command line flag --projects-dir that enables searching outside of the built-in directory. BUG=b:271448278 BRANCH=none TEST=chameleon build Change-Id: I044ca41328ed4ae1bd76c05951b17e0917f15212 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4310910 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'zephyr/zmake/zmake/zmake.py')
-rw-r--r--zephyr/zmake/zmake/zmake.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/zephyr/zmake/zmake/zmake.py b/zephyr/zmake/zmake/zmake.py
index 14dac3912f..69ffcdd64c 100644
--- a/zephyr/zmake/zmake/zmake.py
+++ b/zephyr/zmake/zmake/zmake.py
@@ -164,6 +164,7 @@ class Zmake:
goma=False,
gomacc="/mnt/host/depot_tools/.cipd_bin/gomacc",
modules_dir=None,
+ projects_dir=None,
zephyr_base=None,
):
zmake.multiproc.LogWriter.reset()
@@ -185,6 +186,11 @@ class Zmake:
self.checkout
)
+ if projects_dir:
+ self.projects_dir = projects_dir.resolve()
+ else:
+ self.projects_dir = self.module_paths["ec"] / "zephyr"
+
if jobserver:
self.jobserver = jobserver
else:
@@ -211,9 +217,7 @@ class Zmake:
Returns a list of projects.
"""
- found_projects = zmake.project.find_projects(
- self.module_paths["ec"] / "zephyr"
- )
+ found_projects = zmake.project.find_projects(self.projects_dir)
if all_projects:
projects = set(found_projects.values())
else:
@@ -934,18 +938,13 @@ class Zmake:
raise OSError(get_process_failure_msg(proc))
return 0
- def list_projects(self, fmt, search_dir):
+ def list_projects(self, fmt):
"""List project names known to zmake on stdout.
Args:
fmt: The formatting string to print projects with.
- search_dir: Directory to start the search for
- BUILD.py files at.
"""
- if not search_dir:
- search_dir = self.module_paths["ec"] / "zephyr"
-
- for project in zmake.project.find_projects(search_dir).values():
+ for project in zmake.project.find_projects(self.projects_dir).values():
print(fmt.format(config=project.config), end="")
return 0