diff options
| author | hathach <[email protected]> | 2023-06-02 16:11:00 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2023-06-02 16:11:00 +0700 |
| commit | c2bc363f06b81e1758122167d58c40817c4d2e27 (patch) | |
| tree | d982460cfeefcfc7e0f71337d5f9ff54bff6d034 /tools | |
| parent | bb795e6a5eededff57f18336c11b84f5470d4e4e (diff) | |
build g0 g4 iar cmake
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/build_cmake.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/tools/build_cmake.py b/tools/build_cmake.py index d85726213..140105620 100644 --- a/tools/build_cmake.py +++ b/tools/build_cmake.py @@ -13,7 +13,7 @@ SKIPPED = "\033[33mskipped\033[0m" build_separator = '-' * 106 -make_iar_option = 'CC=iccarm' +toolchain_iar = '-DTOOLCHAIN=iar' def filter_with_input(mylist): if len(sys.argv) > 1: @@ -22,7 +22,7 @@ def filter_with_input(mylist): mylist[:] = input_args -def build_family(family, make_option): +def build_family(family, toolchain_option): all_boards = [] for entry in os.scandir("hw/bsp/{}/boards".format(family)): if entry.is_dir() and entry.name != 'pico_sdk': @@ -38,7 +38,7 @@ def build_family(family, make_option): # Generate build r = subprocess.run(f"cmake examples -B {build_dir} -G \"Ninja\" -DFAMILY={family} -DBOARD" - f"={board}", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + f"={board} {toolchain_option}", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # Build if r.returncode == 0: @@ -57,21 +57,26 @@ def build_family(family, make_option): flash_size = "-" sram_size = "-" example = 'all' - print(build_utils.build_format.format(example, board, status, "{:.2f}s".format(duration), flash_size, sram_size)) + title = build_utils.build_format.format(example, board, status, "{:.2f}s".format(duration), flash_size, sram_size) - if r.returncode != 0: - # group output in CI - print(f"::group::{board} build error") + if os.getenv('CI'): + # always print build output if in CI + print(f"::group::{title} build error") print(r.stdout.decode("utf-8")) print(f"::endgroup::") + else: + # print build output if failed + print(title) + if r.returncode != 0: + print(r.stdout.decode("utf-8")) return ret if __name__ == '__main__': # IAR CC - if make_iar_option not in sys.argv: - make_iar_option = '' + if toolchain_iar not in sys.argv: + toolchain_iar = '' # If family are not specified in arguments, build all supported all_families = [] @@ -88,7 +93,7 @@ if __name__ == '__main__': # succeeded, failed, skipped total_result = [0, 0, 0] for family in all_families: - fret = build_family(family, make_iar_option) + fret = build_family(family, toolchain_iar) if len(fret) == len(total_result): total_result = [total_result[i] + fret[i] for i in range(len(fret))] |
