From 2306b0d78c2b025b0cf3d6771937bb71aef142e2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 12 Jan 2020 12:02:12 +0100 Subject: [PATCH] android/build.py: append API level to LLVM triple This implicitly defines __ANDROID_API__, which means we can drop the "-D__ANDROID_API__=" parameter. This is recommended on https://android.googlesource.com/platform/ndk/+/ndk-release-r20/docs/BuildSystemMaintainers.md --- android/build.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/android/build.py b/android/build.py index 897666261..cfa3c461b 100755 --- a/android/build.py +++ b/android/build.py @@ -92,7 +92,7 @@ class AndroidNdkToolchain: toolchain_path = os.path.join(ndk_path, 'toolchains', abi_info['toolchain_arch'] + '-' + gcc_version, 'prebuilt', build_arch) llvm_path = os.path.join(ndk_path, 'toolchains', 'llvm', 'prebuilt', build_arch) - llvm_triple = abi_info['llvm_triple'] + llvm_triple = abi_info['llvm_triple'] + android_api_level common_flags = '-Os -g' common_flags += ' -fPIC' @@ -115,8 +115,7 @@ class AndroidNdkToolchain: self.cxxflags = common_flags self.cppflags = '--sysroot=' + sysroot + \ ' -isystem ' + os.path.join(install_prefix, 'include') + \ - ' -isystem ' + os.path.join(sysroot, 'usr', 'include', arch) + \ - ' -D__ANDROID_API__=' + android_api_level + ' -isystem ' + os.path.join(sysroot, 'usr', 'include', arch) self.ldflags = '--sysroot=' + sysroot + \ ' -L' + os.path.join(install_prefix, 'lib') + \ ' -L' + os.path.join(target_root, 'usr', 'lib') + \