Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added argument "--ndk-toolchain-version" #264

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"COMPILE_ARG_NDK_MODE" : "Set the compiling mode of ndk-build, should be debug|release|none, native code will not be compiled when the value is none. Default is same value with '-m'.",
"COMPILE_ARG_APP_ABI" : "Set the APP_ABI of ndk-build.Can be multi value separated with ':'. Sample : --app-aib armeabi:x86:mips. Default value is 'armeabi'.",
"COMPILE_ARG_TOOLCHAIN" : "Specify the NDK_TOOLCHAIN of ndk-build.",
"COMPILE_ARG_TOOLCHAIN_VERSION" : "Specify the NDK_TOOLCHAIN_VERSION of ndk-build.",
"COMPILE_ARG_CPPFLAGS" : "Specify the APP_CPPFLAGS of ndk-build.",
"COMPILE_ARG_STUDIO" : "Use the Android Studio project for Android platform.",
"COMPILE_ARG_GROUP_WEB" : "Web Options",
Expand Down Expand Up @@ -424,6 +425,7 @@
"COMPILE_ARG_NDK_MODE" : "设置 ndk-build 的模式,可选值为 debug|release|none,如果指定为 none,ndk-build 不会被调用。默认值与 '-m' 参数值相同。",
"COMPILE_ARG_APP_ABI" : "设置 ndk-build 的 APP_ABI 属性。可以使用 ':' 分隔多个值。示例:--app-aib armeabi:x86:mips。默认值为 'armeabi'。",
"COMPILE_ARG_TOOLCHAIN" : "指定 ndk-build 的 NDK_TOOLCHAIN 属性。",
"COMPILE_ARG_TOOLCHAIN_VERSION" : "指定 ndk-build 的 NDK_TOOLCHAIN_VERSION 属性。",
"COMPILE_ARG_CPPFLAGS" : "指定 ndk-build 的 APP_CPPFLAGS 属性。",
"COMPILE_ARG_STUDIO" : "使用 Android Studio 工程来编译 Android 平台。",
"COMPILE_ARG_GROUP_WEB" : "Web 相关参数",
Expand Down
3 changes: 3 additions & 0 deletions plugins/project_compile/build_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ def get_toolchain_version(self, ndk_root, compile_obj):
except:
cocos.Logging.warning(MultiLanguage.get_string('COMPILE_WARNING_GET_NDK_VER_FAILED_FMT', version_file_path))

if compile_obj.ndk_toolchain_version:
ret_version = compile_obj.ndk_toolchain_version

cocos.Logging.info(MultiLanguage.get_string('COMPILE_INFO_NDK_TOOLCHAIN_VER_FMT', ret_version))
if ret_version == "4.8":
compile_obj.add_warning_at_end(MultiLanguage.get_string('COMPILE_WARNING_TOOLCHAIN_FMT', ret_version))
Expand Down
6 changes: 6 additions & 0 deletions plugins/project_compile/project_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def _add_custom_options(self, parser):
help=MultiLanguage.get_string('COMPILE_ARG_APP_ABI'))
group.add_argument("--ndk-toolchain", dest="toolchain",
help=MultiLanguage.get_string('COMPILE_ARG_TOOLCHAIN'))
group.add_argument("--ndk-toolchain-version", dest="toolchain_version",
help=MultiLanguage.get_string('COMPILE_ARG_TOOLCHAIN_VERSION'))
group.add_argument("--ndk-cppflags", dest="cppflags",
help=MultiLanguage.get_string('COMPILE_ARG_CPPFLAGS'))
group.add_argument("--android-studio", dest="use_studio", action="store_true",
Expand Down Expand Up @@ -145,6 +147,10 @@ def _check_custom_options(self, args):
if args.toolchain:
self.ndk_toolchain = args.toolchain

self.ndk_toolchain_version = None
if args.toolchain_version:
self.ndk_toolchain_version = args.toolchain_version

self.use_studio = args.use_studio

# iOS/Mac arguments
Expand Down