mirror of https://github.com/ARMmbed/mbed-os.git
Add profile argument to mbed-os example build tools to allow non-default build profiles to be passed in
parent
0b5043ea5b
commit
3c3e2800b8
|
@ -54,6 +54,11 @@ def main():
|
||||||
argparse_force_uppercase_type(
|
argparse_force_uppercase_type(
|
||||||
official_target_names, "MCU")),
|
official_target_names, "MCU")),
|
||||||
default=official_target_names)
|
default=official_target_names)
|
||||||
|
|
||||||
|
compile_cmd.add_argument("-p", "--profile",
|
||||||
|
help=("build profile file"),
|
||||||
|
metavar="profile")
|
||||||
|
|
||||||
export_cmd = subparsers.add_parser("export")
|
export_cmd = subparsers.add_parser("export")
|
||||||
export_cmd.set_defaults(fn=do_export),
|
export_cmd.set_defaults(fn=do_export),
|
||||||
export_cmd.add_argument(
|
export_cmd.add_argument(
|
||||||
|
@ -111,7 +116,7 @@ def do_deploy(_, config, examples):
|
||||||
def do_compile(args, config, examples):
|
def do_compile(args, config, examples):
|
||||||
"""Do the compile step"""
|
"""Do the compile step"""
|
||||||
results = {}
|
results = {}
|
||||||
results = lib.compile_repos(config, args.toolchains, args.mcu, examples)
|
results = lib.compile_repos(config, args.toolchains, args.mcu, args.profile, examples)
|
||||||
|
|
||||||
lib.print_summary(results)
|
lib.print_summary(results)
|
||||||
failures = lib.get_num_failures(results)
|
failures = lib.get_num_failures(results)
|
||||||
|
|
|
@ -314,7 +314,7 @@ def export_repos(config, ides, targets, examples):
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
def compile_repos(config, toolchains, targets, examples):
|
def compile_repos(config, toolchains, targets, profile, examples):
|
||||||
"""Compiles combinations of example programs, targets and compile chains.
|
"""Compiles combinations of example programs, targets and compile chains.
|
||||||
|
|
||||||
The results are returned in a [key: value] dictionary format:
|
The results are returned in a [key: value] dictionary format:
|
||||||
|
@ -358,8 +358,14 @@ def compile_repos(config, toolchains, targets, examples):
|
||||||
valid_choices(example['toolchains'], toolchains),
|
valid_choices(example['toolchains'], toolchains),
|
||||||
example['features']):
|
example['features']):
|
||||||
print("Compiling %s for %s, %s" % (name, target, toolchain))
|
print("Compiling %s for %s, %s" % (name, target, toolchain))
|
||||||
proc = subprocess.Popen(["mbed-cli", "compile", "-t", toolchain,
|
build_command = ["mbed-cli", "compile", "-t", toolchain, "-m", target, "-v"]
|
||||||
"-m", target, "-v"])
|
|
||||||
|
if profile:
|
||||||
|
build_command.append("--profile")
|
||||||
|
build_command.append(profile)
|
||||||
|
|
||||||
|
proc = subprocess.Popen(build_command)
|
||||||
|
|
||||||
proc.wait()
|
proc.wait()
|
||||||
example_summary = "{} {} {}".format(name, target, toolchain)
|
example_summary = "{} {} {}".format(name, target, toolchain)
|
||||||
if proc.returncode:
|
if proc.returncode:
|
||||||
|
|
Loading…
Reference in New Issue