android/build.py: simplify libc++ flags

By telling clang which implementation to use, we avoid the dependency
on libstdc++.so.
This commit is contained in:
Max Kellermann 2018-01-19 22:36:03 +01:00
parent fcaedec2ab
commit cad5d11261
1 changed files with 5 additions and 7 deletions

View File

@ -101,15 +101,13 @@ class AndroidNdkToolchain:
libcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/llvm-libc++') libcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/llvm-libc++')
libcxx_libs_path = os.path.join(libcxx_path, 'libs', android_abi) 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_flags = '-stdlib=libc++'
libstdcxx_ldadd = os.path.join(libcxx_libs_path, 'libc++_static.a') + ' ' + os.path.join(libcxx_libs_path, 'libc++abi.a') libstdcxx_cxxflags = libstdcxx_flags + ' -isystem ' + os.path.join(libcxx_path, 'include') + ' -isystem ' + os.path.join(ndk_path, 'sources/android/support/include')
libstdcxx_ldflags = libstdcxx_flags + ' -static-libstdc++ -L' + libcxx_libs_path
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.cxxflags += ' ' + libstdcxx_cxxflags
self.cppflags += ' ' + libstdcxx_cppflags self.ldflags += ' ' + libstdcxx_ldflags
self.env = dict(os.environ) self.env = dict(os.environ)