From 88957b4c9d9dffcbb7bb39655161965d4973197b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 1 Mar 2017 17:17:49 +0100 Subject: [PATCH] android/build.py: build with libc++ instead of GNU libstdc++ Android is migrating away from GCC, and libstdc++ will disappear eventually. --- android/build.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/android/build.py b/android/build.py index ac68ba47c..a37432e13 100755 --- a/android/build.py +++ b/android/build.py @@ -87,9 +87,14 @@ class AndroidNdkToolchain: self.is_armv7 = self.is_arm and 'armv7' in self.cflags self.is_windows = False - libstdcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/gnu-libstdc++', gcc_version) - libstdcxx_cppflags = '-isystem ' + os.path.join(libstdcxx_path, 'include') + ' -isystem ' + os.path.join(libstdcxx_path, 'libs', android_abi, 'include') - libstdcxx_ldadd = os.path.join(libstdcxx_path, 'libs', android_abi, 'libgnustl_static.a') + libcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/llvm-libc++') + libcxx_libs_path = os.path.join(libcxx_path, 'libs', android_abi) + + libstdcxx_cppflags = '-nostdinc++ -isystem ' + os.path.join(libcxx_path, 'include') + ' -isystem ' + os.path.join(ndk_path, 'sources/android/support/include') + libstdcxx_ldadd = os.path.join(libcxx_libs_path, 'libc++_static.a') + ' ' + os.path.join(libcxx_libs_path, 'libc++abi.a') + + if self.is_armv7: + libstdcxx_ldadd += ' ' + os.path.join(libcxx_libs_path, 'libunwind.a') if use_cxx: self.libs += ' ' + libstdcxx_ldadd