From cad5d11261de8fea87b8568587f698cb0794e77f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 19 Jan 2018 22:36:03 +0100 Subject: [PATCH] android/build.py: simplify libc++ flags By telling clang which implementation to use, we avoid the dependency on libstdc++.so. --- android/build.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/android/build.py b/android/build.py index 393f1d7da..c2ee971e2 100755 --- a/android/build.py +++ b/android/build.py @@ -101,15 +101,13 @@ class AndroidNdkToolchain: 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') + libstdcxx_flags = '-stdlib=libc++' + 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 use_cxx: - self.libs += ' ' + libstdcxx_ldadd - self.cppflags += ' ' + libstdcxx_cppflags + self.cxxflags += ' ' + libstdcxx_cxxflags + self.ldflags += ' ' + libstdcxx_ldflags self.env = dict(os.environ)