mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
update build script to support iar with CC=iccarm option
This commit is contained in:
parent
1891802f08
commit
c86e628a4c
2
.github/workflows/build_iar_arm.yml
vendored
2
.github/workflows/build_iar_arm.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Build IAR for ARM
|
name: Build ARM with IAR
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -52,7 +52,7 @@ if __name__ == '__main__':
|
|||||||
for example in all_examples:
|
for example in all_examples:
|
||||||
print(build_separator)
|
print(build_separator)
|
||||||
with Pool(processes=os.cpu_count()) as pool:
|
with Pool(processes=os.cpu_count()) as pool:
|
||||||
pool_args = list((map(lambda b, e=example: [e, b], all_boards)))
|
pool_args = list((map(lambda b, e=example, o='': [e, b, o], all_boards)))
|
||||||
result = pool.starmap(build_utils.build_example, pool_args)
|
result = pool.starmap(build_utils.build_example, pool_args)
|
||||||
# sum all element of same index (column sum)
|
# sum all element of same index (column sum)
|
||||||
result = list(map(sum, list(zip(*result))))
|
result = list(map(sum, list(zip(*result))))
|
||||||
|
@ -11,6 +11,7 @@ SKIPPED = "\033[33mskipped\033[0m"
|
|||||||
|
|
||||||
build_separator = '-' * 106
|
build_separator = '-' * 106
|
||||||
|
|
||||||
|
make_iar_option = 'CC=iccarm'
|
||||||
|
|
||||||
def filter_with_input(mylist):
|
def filter_with_input(mylist):
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
@ -19,7 +20,7 @@ def filter_with_input(mylist):
|
|||||||
mylist[:] = input_args
|
mylist[:] = input_args
|
||||||
|
|
||||||
|
|
||||||
def build_family(example, family):
|
def build_family(example, family, make_option):
|
||||||
all_boards = []
|
all_boards = []
|
||||||
for entry in os.scandir("hw/bsp/{}/boards".format(family)):
|
for entry in os.scandir("hw/bsp/{}/boards".format(family)):
|
||||||
if entry.is_dir() and entry.name != 'pico_sdk':
|
if entry.is_dir() and entry.name != 'pico_sdk':
|
||||||
@ -28,13 +29,17 @@ def build_family(example, family):
|
|||||||
all_boards.sort()
|
all_boards.sort()
|
||||||
|
|
||||||
with Pool(processes=os.cpu_count()) as pool:
|
with Pool(processes=os.cpu_count()) as pool:
|
||||||
pool_args = list((map(lambda b, e=example: [e, b], all_boards)))
|
pool_args = list((map(lambda b, e=example, o=make_option: [e, b, o], all_boards)))
|
||||||
result = pool.starmap(build_utils.build_example, pool_args)
|
result = pool.starmap(build_utils.build_example, pool_args)
|
||||||
# sum all element of same index (column sum)
|
# sum all element of same index (column sum)
|
||||||
return list(map(sum, list(zip(*result))))
|
return list(map(sum, list(zip(*result))))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
# IAR CC
|
||||||
|
if make_iar_option not in sys.argv:
|
||||||
|
make_iar_option = ''
|
||||||
|
|
||||||
# If examples are not specified in arguments, build all
|
# If examples are not specified in arguments, build all
|
||||||
all_examples = []
|
all_examples = []
|
||||||
for dir1 in os.scandir("examples"):
|
for dir1 in os.scandir("examples"):
|
||||||
@ -62,7 +67,7 @@ if __name__ == '__main__':
|
|||||||
for example in all_examples:
|
for example in all_examples:
|
||||||
print(build_separator)
|
print(build_separator)
|
||||||
for family in all_families:
|
for family in all_families:
|
||||||
fret = build_family(example, family)
|
fret = build_family(example, family, make_iar_option)
|
||||||
total_result = list(map(lambda x, y: x + y, total_result, fret))
|
total_result = list(map(lambda x, y: x + y, total_result, fret))
|
||||||
|
|
||||||
total_time = time.monotonic() - total_time
|
total_time = time.monotonic() - total_time
|
||||||
|
@ -77,7 +77,7 @@ def skip_example(example, board):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def build_example(example, board):
|
def build_example(example, board, make_option):
|
||||||
start_time = time.monotonic()
|
start_time = time.monotonic()
|
||||||
flash_size = "-"
|
flash_size = "-"
|
||||||
sram_size = "-"
|
sram_size = "-"
|
||||||
@ -91,14 +91,14 @@ def build_example(example, board):
|
|||||||
ret[2] = 1
|
ret[2] = 1
|
||||||
print(build_format.format(example, board, status, '-', flash_size, sram_size))
|
print(build_format.format(example, board, status, '-', flash_size, sram_size))
|
||||||
else:
|
else:
|
||||||
build_result = subprocess.run("make -j -C examples/{} BOARD={} all".format(example, board), shell=True,
|
build_result = subprocess.run("make -j -C examples/{} BOARD={} {} all".format(example, board, make_option), shell=True,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
if build_result.returncode == 0:
|
if build_result.returncode == 0:
|
||||||
status = SUCCEEDED
|
status = SUCCEEDED
|
||||||
ret[0] = 1
|
ret[0] = 1
|
||||||
(flash_size, sram_size) = build_size(example, board)
|
(flash_size, sram_size) = build_size(example, board)
|
||||||
subprocess.run("make -j -C examples/{} BOARD={} copy-artifact".format(example, board), shell=True,
|
subprocess.run("make -j -C examples/{} BOARD={} {} copy-artifact".format(example, board, make_option), shell=True,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
else:
|
else:
|
||||||
status = FAILED
|
status = FAILED
|
||||||
|
Loading…
x
Reference in New Issue
Block a user