summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-12-22 23:01:14 +0800
committerGitHub <[email protected]>2018-12-22 23:01:14 +0800
commit42de73ec9745599c166fc97ada4faa28c5a45e55 (patch)
tree093c6469c5d9035d3ab860de44abf7f427c4aa37
parentc727b7173ddd2a9f617275d5876e73dddb880543 (diff)
parentf114c56acb0264a094a99ceff5f45735ea17e54c (diff)
Merge pull request #303 from orzuk-lmj/dev
improve abi include directory for ndk
-rw-r--r--xmake/platforms/android/load.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/platforms/android/load.lua b/xmake/platforms/android/load.lua
index 1575ee4f9..836871b9a 100644
--- a/xmake/platforms/android/load.lua
+++ b/xmake/platforms/android/load.lua
@@ -172,6 +172,8 @@ function main(platform)
platform:add("cxxflags", format("-I%s/libs/%s/include", cxxstl_sdkdir, toolchains_archs[arch]))
platform:add("ldflags", format("-L%s/libs/%s", cxxstl_sdkdir, toolchains_archs[arch]))
platform:add("shflags", format("-L%s/libs/%s", cxxstl_sdkdir, toolchains_archs[arch]))
+
+ -- link to c++ std library
if cxxstl_sdkdir:find("llvm-libc++", 1, true) then
platform:add("ldflags", "-lc++_static", "-lc++abi")
platform:add("shflags", "-lc++_static", "-lc++abi")
@@ -179,6 +181,18 @@ function main(platform)
platform:add("ldflags", "-lgnustl_static")
platform:add("shflags", "-lgnustl_static")
end
+
+ -- include abi directory
+ if cxxstl_sdkdir:find("llvm-libc++", 1, true) then
+ local abi_path = path.join(ndk, "sources", "cxx-stl", "llvm-libc++abi")
+ local before_r13 = path.join(abi_path, "libcxxabi")
+ local after_r13 = path.join(abi_path, "include")
+ if os.isdir(before_r13) then
+ platform:add("cxxflags", "-I" .. before_r13)
+ elseif os.isdir(after_r13) then
+ platform:add("cxxflags", "-I" .. after_r13)
+ end
+ end
end
end
end