1313
1414build_separator = '-' * 106
1515
16- toolchain_iar = '-DTOOLCHAIN=iar'
17-
1816def filter_with_input (mylist ):
1917 if len (sys .argv ) > 1 :
2018 input_args = list (set (mylist ).intersection (sys .argv ))
2119 if len (input_args ) > 0 :
2220 mylist [:] = input_args
2321
2422
25- def build_family (family , toolchain_option ):
23+ def build_family (family , cmake_option ):
2624 all_boards = []
2725 for entry in os .scandir ("hw/bsp/{}/boards" .format (family )):
2826 if entry .is_dir () and entry .name != 'pico_sdk' :
@@ -38,7 +36,7 @@ def build_family(family, toolchain_option):
3836
3937 # Generate build
4038 r = subprocess .run (f"cmake examples -B { build_dir } -G \" Ninja\" -DFAMILY={ family } -DBOARD"
41- f"={ board } { toolchain_option } " , shell = True , stdout = subprocess .PIPE , stderr = subprocess .STDOUT )
39+ f"={ board } { cmake_option } " , shell = True , stdout = subprocess .PIPE , stderr = subprocess .STDOUT )
4240
4341 # Build
4442 if r .returncode == 0 :
@@ -74,9 +72,10 @@ def build_family(family, toolchain_option):
7472
7573
7674if __name__ == '__main__' :
77- # IAR CC
78- if toolchain_iar not in sys .argv :
79- toolchain_iar = ''
75+ cmake_options = ''
76+ for a in sys .argv [1 :]:
77+ if a .startswith ('-' ):
78+ cmake_options += ' ' + a
8079
8180 # If family are not specified in arguments, build all supported
8281 all_families = []
@@ -93,7 +92,7 @@ def build_family(family, toolchain_option):
9392 # succeeded, failed, skipped
9493 total_result = [0 , 0 , 0 ]
9594 for family in all_families :
96- fret = build_family (family , toolchain_iar )
95+ fret = build_family (family , cmake_options )
9796 if len (fret ) == len (total_result ):
9897 total_result = [total_result [i ] + fret [i ] for i in range (len (fret ))]
9998
0 commit comments