mirror of
https://github.com/sipeed/MaixCDK.git
synced 2026-09-10 21:59:54 -05:00
optimize build scripts
This commit is contained in:
@@ -21,7 +21,7 @@ function build_start()
|
||||
maixtool release
|
||||
else
|
||||
maixcdk distclean
|
||||
maixcdk release -p "$platform"
|
||||
maixcdk release -p "$platform" --toolchain-id default
|
||||
fi
|
||||
mkdir -p ../apps
|
||||
cp -r dist/pack/* ../apps
|
||||
|
||||
@@ -27,7 +27,7 @@ def select_multi_toolchain(board_name, toolchain_info, select_id):
|
||||
if not "id" in info:
|
||||
print("Error: id not found in toolchain info of board %s.yaml" % board_name)
|
||||
sys.exit(1)
|
||||
if select_id and info['id'] == select_id:
|
||||
if select_id and (info['id'] == select_id or (select_id == "default" and info.get("default", False))):
|
||||
return info
|
||||
print("This platform has multiple toolchains, please select one\n")
|
||||
default_idx = None
|
||||
|
||||
@@ -218,7 +218,7 @@ def parse_args(sdk_path, project_path, extra_tools):
|
||||
parser_.add_argument('--debug', action="store_true", default=False, help="debug mode, default is release mode")
|
||||
parser_.add_argument('--build-type', default=None, help="build type, [Debug, Release, MinRelSize, RelWithDebInfo], you can also set build type by CMAKE_BUILD_TYPE environment variable")
|
||||
parser_.add_argument('-p', "--platform", default="", help="device name, e.g. linux, maixcam, m2dock", choices=get_platforms(sdk_path))
|
||||
parser_.add_argument('--toolchain-id', default="", help="toolchain id, if platform has multiple toolchains, use this option to select one")
|
||||
parser_.add_argument('--toolchain-id', default="", help="toolchain id, if platform has multiple toolchains, use this option to select one. Empty will let you select one interactively, 'default' means use the default toolchain defined in platform yaml file.")
|
||||
add_build_args(parser_build)
|
||||
add_build_args(parser_build2)
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ parser = argparse.ArgumentParser(prog="release", description="release program as
|
||||
|
||||
############################### Add option here #############################
|
||||
parser.add_argument("-p", "--platform", help="Select platforms, use maixcdk build --help to see supported platforms", default="")
|
||||
parser.add_argument('--toolchain-id', default="", help="toolchain id, if platform has multiple toolchains, use this option to select one. Empty will let you select one interactively, 'default' means use the default toolchain defined in platform yaml file.")
|
||||
|
||||
#############################################################################
|
||||
|
||||
@@ -46,6 +47,9 @@ def main(vars):
|
||||
if vars["project_args"].platform:
|
||||
cmd.append("--platform")
|
||||
cmd.append(vars["project_args"].platform)
|
||||
if vars["project_args"].toolchain_id:
|
||||
cmd.append("--toolchain-id")
|
||||
cmd.append(vars["project_args"].toolchain_id)
|
||||
exit_code = subprocess.Popen(cmd).wait()
|
||||
print("--------- rebuild complete ------------\n")
|
||||
if exit_code != 0:
|
||||
|
||||
Reference in New Issue
Block a user