Toolchain support for Android ARM64 targets (#14394)
This commit is contained in:
@@ -126,6 +126,9 @@ class AndroidDevice extends Device {
|
||||
if (_platform == null) {
|
||||
// http://developer.android.com/ndk/guides/abis.html (x86, armeabi-v7a, ...)
|
||||
switch (await _getProperty('ro.product.cpu.abi')) {
|
||||
case 'arm64-v8a':
|
||||
_platform = TargetPlatform.android_arm64;
|
||||
break;
|
||||
case 'x86_64':
|
||||
_platform = TargetPlatform.android_x64;
|
||||
break;
|
||||
@@ -355,16 +358,23 @@ class AndroidDevice extends Device {
|
||||
if (!await _checkForSupportedAdbVersion() || !await _checkForSupportedAndroidVersion())
|
||||
return new LaunchResult.failed();
|
||||
|
||||
if (await targetPlatform != TargetPlatform.android_arm && !debuggingOptions.buildInfo.isDebug) {
|
||||
final TargetPlatform devicePlatform = await targetPlatform;
|
||||
if (!(devicePlatform == TargetPlatform.android_arm ||
|
||||
devicePlatform == TargetPlatform.android_arm64) &&
|
||||
!debuggingOptions.buildInfo.isDebug) {
|
||||
printError('Profile and release builds are only supported on ARM targets.');
|
||||
return new LaunchResult.failed();
|
||||
}
|
||||
|
||||
BuildInfo buildInfo = debuggingOptions.buildInfo;
|
||||
if (devicePlatform == TargetPlatform.android_arm64)
|
||||
buildInfo = buildInfo.withTargetPlatform(TargetPlatform.android_arm64);
|
||||
|
||||
if (!prebuiltApplication) {
|
||||
printTrace('Building APK');
|
||||
await buildApk(
|
||||
target: mainPath,
|
||||
buildInfo: debuggingOptions.buildInfo,
|
||||
buildInfo: buildInfo,
|
||||
);
|
||||
// Package has been built, so we can get the updated application ID and
|
||||
// activity name from the .apk.
|
||||
|
||||
@@ -301,6 +301,8 @@ Future<Null> _buildGradleProjectV2(String gradle, BuildInfo buildInfo, String ta
|
||||
if (buildInfo.preferSharedLibrary && androidSdk.ndkCompiler != null) {
|
||||
command.add('-Pprefer-shared-library=true');
|
||||
}
|
||||
if (buildInfo.targetPlatform == TargetPlatform.android_arm64)
|
||||
command.add('-Ptarget-platform=android-arm64');
|
||||
|
||||
command.add(assembleTask);
|
||||
final int exitCode = await runCommandAndStreamOutput(
|
||||
|
||||
Reference in New Issue
Block a user