@@ -39,7 +39,7 @@ def setup_project(ide, target, program=None, source_dir=None, build=None):
39
39
if source_dir :
40
40
# --source is used to generate IDE files to toolchain directly
41
41
# in the source tree and doesn't generate zip file
42
- project_dir = join ( source_dir [0 ], 'projectfiles' , ide + "_" + target )
42
+ project_dir = source_dir [0 ]
43
43
if program :
44
44
project_name = TESTS [program ]
45
45
else :
@@ -63,7 +63,7 @@ def setup_project(ide, target, program=None, source_dir=None, build=None):
63
63
64
64
65
65
def export (target , ide , build = None , src = None , macros = None , project_id = None ,
66
- clean = False , zip_proj = False ):
66
+ clean = False , zip_proj = False , options = None ):
67
67
"""Do an export of a project.
68
68
69
69
Positional arguments:
@@ -84,7 +84,7 @@ def export(target, ide, build=None, src=None, macros=None, project_id=None,
84
84
zip_name = name + ".zip" if zip_proj else None
85
85
86
86
export_project (src , project_dir , target , ide , clean = clean , name = name ,
87
- macros = macros , libraries_paths = lib , zip_proj = zip_name )
87
+ macros = macros , libraries_paths = lib , zip_proj = zip_name , options = options )
88
88
89
89
90
90
def main ():
@@ -100,8 +100,7 @@ def main():
100
100
parser .add_argument ("-m" , "--mcu" ,
101
101
metavar = "MCU" ,
102
102
default = 'LPC1768' ,
103
- type = argparse_many (
104
- argparse_force_uppercase_type (targetnames , "MCU" )),
103
+ type = argparse_force_uppercase_type (targetnames , "MCU" ),
105
104
help = "generate project for the given MCU ({})" .format (
106
105
', ' .join (targetnames )))
107
106
@@ -165,6 +164,12 @@ def main():
165
164
dest = "macros" ,
166
165
help = "Add a macro definition" )
167
166
167
+ parser .add_argument ("-o" ,
168
+ type = argparse_many (str ),
169
+ dest = "opts" ,
170
+ default = ["debug-info" ],
171
+ help = "Toolchain options" )
172
+
168
173
options = parser .parse_args ()
169
174
170
175
# Print available tests in order and exit
@@ -212,10 +217,10 @@ def main():
212
217
if (options .program is None ) and (not options .source_dir ):
213
218
args_error (parser , "one of -p, -n, or --source is required" )
214
219
# Export to selected toolchain
215
- for mcu in options .mcu :
216
- export ( mcu , options . ide , build = options .build , src = options .source_dir ,
217
- macros = options .macros , project_id = options .program ,
218
- clean = options . clean , zip_proj = zip_proj )
220
+ export ( options . mcu , options . ide , build = options .build ,
221
+ src = options .source_dir , macros = options .macros ,
222
+ project_id = options .program , clean = options .clean ,
223
+ zip_proj = zip_proj , options = options . opts )
219
224
220
225
221
226
if __name__ == "__main__" :
0 commit comments