android/build.py: build with libc++ instead of GNU libstdc++

Android is migrating away from GCC, and libstdc++ will disappear
eventually.
This commit is contained in:
Max Kellermann 2017-03-01 17:17:49 +01:00
parent b2f2c9322b
commit 88957b4c9d
1 changed files with 8 additions and 3 deletions

View File

@ -87,9 +87,14 @@ class AndroidNdkToolchain:
self.is_armv7 = self.is_arm and 'armv7' in self.cflags self.is_armv7 = self.is_arm and 'armv7' in self.cflags
self.is_windows = False self.is_windows = False
libstdcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/gnu-libstdc++', gcc_version) libcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/llvm-libc++')
libstdcxx_cppflags = '-isystem ' + os.path.join(libstdcxx_path, 'include') + ' -isystem ' + os.path.join(libstdcxx_path, 'libs', android_abi, 'include') libcxx_libs_path = os.path.join(libcxx_path, 'libs', android_abi)
libstdcxx_ldadd = os.path.join(libstdcxx_path, 'libs', android_abi, 'libgnustl_static.a')
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: if use_cxx:
self.libs += ' ' + libstdcxx_ldadd self.libs += ' ' + libstdcxx_ldadd