diff options
author | Tom Hughes <tomhughes@chromium.org> | 2022-11-15 13:21:48 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-11-16 23:20:08 +0000 |
commit | fcc7716bf1461477a3b3d8a53b85fdc81df677e4 (patch) | |
tree | 5eb82948046e425b0f57fefda03c36a33d1e7e2c | |
parent | c45cb8764f3c4c5b1917488aac7bb6a5be7b5be4 (diff) | |
download | chrome-ec-fcc7716bf1461477a3b3d8a53b85fdc81df677e4.tar.gz |
util/build_with_clang: Add option to remove build directory
By default remove the build directory, but allow disabling it with a
flag.
BRANCH=none
BUG=b:172020503
TEST=./util/build_with_clang.py
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I0342768da9e340aa4d84bb695cc97550e305326d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4026667
Reviewed-by: Diana Z <dzigterman@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rwxr-xr-x | util/build_with_clang.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/util/build_with_clang.py b/util/build_with_clang.py index 085dcde8c2..5d662f7bce 100755 --- a/util/build_with_clang.py +++ b/util/build_with_clang.py @@ -10,6 +10,7 @@ import concurrent import logging import multiprocessing import os +import shutil import subprocess import sys import typing @@ -212,7 +213,6 @@ BOARDS_THAT_COMPILE_SUCCESSFULLY_WITH_CLANG = [ "voxel", "voxel_ecmodeentry", "voxel_npcx797fc", - "waddledoo", "waddledoo2", "whiskers", "woomax", @@ -299,6 +299,7 @@ BOARDS_THAT_FAIL_WITH_CLANG = [ "mushu", # overflows flash "terrador", # overflows flash "volteer", # overflows flash + "waddledoo", # overflows flash ] # TODO(b/201311714): NDS32 is not supported by LLVM. @@ -362,9 +363,27 @@ def main() -> int: "--num_threads", "-j", type=int, default=multiprocessing.cpu_count() ) + group = parser.add_mutually_exclusive_group(required=False) + group.add_argument( + "--clean", + action="store_true", + help="Remove build directory before compiling", + ) + group.add_argument( + "--no-clean", + dest="clean", + action="store_false", + help="Do not remove build directory before compiling", + ) + parser.set_defaults(clean=True) + args = parser.parse_args() logging.basicConfig(level=args.log_level) + if args.clean: + logging.debug("Removing build directory") + shutil.rmtree("./build", ignore_errors=True) + check_boards() logging.debug("Building with %d threads", args.num_threads) |