summaryrefslogtreecommitdiff
path: root/zephyr/zmake/zmake/util.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-12 19:56:19 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-18 17:23:50 +0000
commitdb3d75fed17094bacb637e1a5b941149f1087375 (patch)
treee4cfe7a8c8938aa98309be065e2ade5b18403de4 /zephyr/zmake/zmake/util.py
parentb54655a55feb3d98dbad7e23965d953d8326186d (diff)
downloadchrome-ec-db3d75fed17094bacb637e1a5b941149f1087375.tar.gz
zephyr: zmake: Always used the supplied build directory
If --build-dir is provided it seems better to always use it. The current logic in resolve_build_dir() assumes that the build will progress far enough that we recognise the build directory. If it doesn't, then the flag is ignored and we build in a default location. It isn't clear to me why that is better than always using the directory. Drop this unnecessary logic. BRANCH=none BUG=b:178731498 TEST=pytest zephyr/zmake/ zmake configure -B /tmp/z/vol zephyr/projects/volteer/ -t zephyr && zmake build /tmp/z/vol in the chroot: FEATURES=test sudo -E emerge -q zephyr-build-tools zmake testall Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I9e46d91e79cc946016cf8d33ed6ea1f3862c977e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2697123 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/zmake/zmake/util.py')
-rw-r--r--zephyr/zmake/zmake/util.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/zephyr/zmake/zmake/util.py b/zephyr/zmake/zmake/util.py
index 946fd41521..1f052a3688 100644
--- a/zephyr/zmake/zmake/util.py
+++ b/zephyr/zmake/zmake/util.py
@@ -180,8 +180,7 @@ def resolve_build_dir(platform_ec_dir, project_dir, build_dir):
Returns:
The resolved build directory (using build_dir if not None).
"""
- if build_dir and (not pathlib.Path.exists(build_dir) or pathlib.Path.exists(
- build_dir / 'project' / 'zmake.yaml')):
+ if build_dir:
return build_dir
if not pathlib.Path.exists(project_dir / 'zmake.yaml'):