summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-10-23 19:32:25 +0200
committerMax Kellermann <max@musicpd.org>2018-10-23 19:32:25 +0200
commitf7d1408a1afd00c9a7f164dae6a82707bc83df6e (patch)
tree66f319a2965c6cfc76612b05f44a33df3c1dc5a2 /android
parente4e14ef6b0ee4a4dd7300c03ab2700669f5be1a6 (diff)
android/build.py: improved libc++ linker flags (for NDK r18)
The flag `-stdlib=libc++` doesn't appear to work because it attempts to load `libc++` and not `libc++_static`, and it omits `libc++abi`.
Diffstat (limited to 'android')
-rwxr-xr-xandroid/build.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/android/build.py b/android/build.py
index caf85f06c..a51dbe3b6 100755
--- a/android/build.py
+++ b/android/build.py
@@ -132,13 +132,15 @@ 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_flags = '-stdlib=libc++'
+ libstdcxx_flags = ''
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
+ libstdcxx_ldflags = libstdcxx_flags + ' -L' + libcxx_libs_path
+ libstdcxx_libs = '-lc++_static -lc++abi'
if use_cxx:
self.cxxflags += ' ' + libstdcxx_cxxflags
self.ldflags += ' ' + libstdcxx_ldflags
+ self.libs += ' ' + libstdcxx_libs
self.env = dict(os.environ)