summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-12-12 09:43:48 +0100
committerMax Kellermann <max@musicpd.org>2017-12-12 10:01:47 +0100
commitd9552d8a6d2fbc916e5a7bf6e75c2d3b4f29c38e (patch)
tree3132d6dc6673956dfc0e321f7fc25ec05d44a971 /android
parent7586a8ab2c4b5423c3d37c60ebce5d67e05c6c83 (diff)
android/build.py: support NDK r16
Diffstat (limited to 'android')
-rwxr-xr-xandroid/build.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/android/build.py b/android/build.py
index 3ec3d9ba3..fab6ecb49 100755
--- a/android/build.py
+++ b/android/build.py
@@ -46,13 +46,14 @@ class AndroidNdkToolchain:
self.ndk_arch = 'arm'
android_abi = 'armeabi-v7a'
- ndk_platform = 'android-14'
+ ndk_platform = 'android-21'
# select the NDK compiler
gcc_version = '4.9'
ndk_platform_path = os.path.join(ndk_path, 'platforms', ndk_platform)
- sysroot = os.path.join(ndk_platform_path, 'arch-' + self.ndk_arch)
+ sysroot = os.path.join(ndk_path, 'sysroot')
+ target_root = os.path.join(ndk_platform_path, 'arch-' + self.ndk_arch)
install_prefix = os.path.join(arch_path, 'root')
@@ -79,8 +80,15 @@ class AndroidNdkToolchain:
self.cflags = '-Os -g ' + common_flags
self.cxxflags = '-Os -g ' + common_flags
- self.cppflags = '--sysroot=' + self.sysroot + ' -isystem ' + os.path.join(install_prefix, 'include')
- self.ldflags = '--sysroot=' + self.sysroot + ' ' + common_flags + ' -L' + os.path.join(install_prefix, 'lib')
+ self.cppflags = '--sysroot=' + sysroot + \
+ ' -isystem ' + os.path.join(install_prefix, 'include') + \
+ ' -isystem ' + os.path.join(sysroot, 'usr', 'include', arch) + \
+ ' -D__ANDROID_API__=21'
+ self.ldflags = '--sysroot=' + sysroot + \
+ ' -L' + os.path.join(install_prefix, 'lib') + \
+ ' -L' + os.path.join(target_root, 'usr', 'lib') + \
+ ' -B' + os.path.join(target_root, 'usr', 'lib') + \
+ ' ' + common_flags
self.libs = ''
self.is_arm = self.ndk_arch == 'arm'