Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit eea85f4

Browse files
committed
[[ API 26 ]] Use app platform 16 with target sdk 26
The NDK platform version used to compile the android engine needs to be 16 at the moment, in order to continue to support older devices (4.1 upwards)
1 parent 355f197 commit eea85f4

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

config.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
BUILDBOT_PLATFORM_TRIPLES = (
2626
'x86-linux-debian8',
2727
'x86_64-linux-debian8',
28-
'armv6-android-api26',
28+
'armv6-android-sdk26_ndk16r15',
2929
'universal-mac-macosx10.9', # Minimum deployment target
3030
'universal-ios-iphoneos11.4',
3131
'universal-ios-iphoneos11.2',
@@ -119,7 +119,8 @@ def exec_gyp(args):
119119
def process_env_options(opts):
120120
vars = ('OS', 'PLATFORM', 'GENERATOR_OUTPUT', 'FORMATS', 'DEPTH',
121121
'WIN_MSVS_VERSION', 'XCODE_TARGET_SDK', 'XCODE_HOST_SDK',
122-
'TARGET_ARCH', 'PERL', 'ANDROID_NDK_VERSION', 'ANDROID_PLATFORM',
122+
'TARGET_ARCH', 'PERL', 'ANDROID_NDK_VERSION',
123+
'ANDROID_NDK_PLATFORM_VERSION', 'ANDROID_PLATFORM',
123124
'ANDROID_SDK', 'ANDROID_NDK', 'ANDROID_BUILD_TOOLS',
124125
'ANDROID_TOOLCHAIN', 'ANDROID_API_VERSION',
125126
'AR', 'CC', 'CXX', 'LINK', 'OBJCOPY', 'OBJDUMP',
@@ -423,6 +424,9 @@ def validate_android_tools(opts):
423424
error('Android NDK not found; set $ANDROID_NDK')
424425
opts['ANDROID_NDK'] = ndk
425426

427+
if opts['ANDROID_NDK_PLATFORM_VERSION'] is None:
428+
opts['ANDROID_NDK_PLATFORM_VERSION'] = '16'
429+
426430
if opts['ANDROID_API_VERSION'] is None:
427431
opts['ANDROID_API_VERSION'] = '26'
428432

@@ -539,6 +543,7 @@ def configure_android(opts):
539543

540544
export_opts(opts, ('ANDROID_BUILD_TOOLS', 'ANDROID_NDK',
541545
'ANDROID_PLATFORM', 'ANDROID_SDK',
546+
'ANDROID_NDK_VERSION', 'ANDROID_NDK_PLATFORM_VERSION',
542547
'ANDROID_API_VERSION',
543548
'JAVA_SDK', 'AR', 'CC', 'CXX', 'LINK', 'OBJCOPY',
544549
'OBJDUMP', 'STRIP'))

config/android.gypi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
'java_sdk_path%': '<!(echo ${JAVA_SDK})',
99
'android_sdk_path%': '<!(echo ${ANDROID_SDK})',
1010
'android_ndk_path%': '<!(echo ${ANDROID_NDK})',
11-
'android_api_version%': '<!(echo ${ANDROID_API_VERSION})',
11+
'android_api_version%': '<!(echo ${ANDROID_API_VERSION})',
12+
'android_ndk_platform_version%': '<!(echo ${ANDROID_NDK_PLATFORM_VERSION})',
13+
'android_ndk_version%': '<!(echo ${ANDROID_NDK_VERSION})',
1214
'android_platform%': '<!(echo ${ANDROID_PLATFORM})',
1315
'android_build_tools%': '<!(echo ${ANDROID_BUILD_TOOLS})',
1416
},
@@ -30,7 +32,7 @@
3032
'strip': '<!(echo ${STRIP:-strip})',
3133

3234
'android_ndk_path%': '<(android_ndk_path)',
33-
'android_api_version%': '<(android_api_version)',
35+
'android_subplatform%': 'sdk<(android_api_version)_ndk<(android_ndk_platform_version)<(android_ndk_version)',
3436
},
3537

3638
'target_defaults':

docs/development/build-android.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Create a standalone toolchain (this simplifies setting up the build environment)
4242

4343
````bash
4444
android-ndk-r15/build/tools/make_standalone_toolchain.py \
45-
--arch arm --api 26 \
45+
--arch arm --api 16 --deprecated-headers \
4646
--install-dir ${HOME}/android/toolchain/standalone
4747
````
4848

@@ -81,6 +81,7 @@ AR="${BINDIR}/${TRIPLE}-ar"
8181

8282
# Android platform information
8383
ANDROID_NDK_VERSION=r15
84+
ANDROID_NDK_PLATFORM_VERSION=16
8485
ANDROID_API_VERSION=26
8586
ANDROID_PLATFORM=android-${ANDROID_API_VERSION}
8687
ANDROID_NDK=${TOOLCHAIN}/android-ndk-${ANDROID_NDK_VERSION}
@@ -90,7 +91,8 @@ ANDROID_LIB_PATH=${TOOLCHAIN}/standalone/${TRIPLE}/lib
9091

9192
export JAVA_SDK
9293
export CC CXX LINK AR
93-
export ANDROID_PLATFORM ANDROID_NDK ANDROID_SDK ANDROID_BUILD_TOOLS
94+
export ANDROID_PLATFORM ANDROID_NDK ANDROID_NDK_PLATFORM_VERSION
95+
export ANDROID_SDK ANDROID_BUILD_TOOLS
9496
export ANDROID_LIB_PATH ANDROID_API_VERSION
9597
````
9698

prebuilt/fetch-libraries.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LIBS_emscripten=( ICU )
1717

1818
SUBPLATFORMS_ios=(iPhoneSimulator8.2 iPhoneSimulator9.2 iPhoneSimulator10.2 iPhoneSimulator11.2 iPhoneSimulator11.4 iPhoneOS9.2 iPhoneOS10.2 iPhoneOS11.2 iPhoneOS11.4)
1919
SUBPLATFORMS_win32=(v140_static_debug v140_static_release)
20-
SUBPLATFORMS_android=(api26)
20+
SUBPLATFORMS_android=(sdk26_ndk16r15)
2121

2222
# Fetch settings
2323
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)

prebuilt/libicu.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
{
185185
'library_dirs':
186186
[
187-
'lib/android/<(target_arch)/api<(android_api_version)',
187+
'lib/android/<(target_arch)/<(android_subplatform)',
188188
],
189189

190190
'libraries':

prebuilt/libopenssl.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
{
122122
'library_dirs':
123123
[
124-
'lib/android/<(target_arch)/api<(android_api_version)',
124+
'lib/android/<(target_arch)/<(android_subplatform)',
125125
],
126126

127127
'libraries':

0 commit comments

Comments
 (0)