diff options
| author | mclee <[email protected]> | 2018-12-22 21:07:17 +0800 |
|---|---|---|
| committer | mclee <[email protected]> | 2018-12-22 21:07:17 +0800 |
| commit | f36a596b3d7a96e92a230c3dd03d4f787efba7bb (patch) | |
| tree | d472ef0b7a5cb175791162a3e68d75c4919b0530 | |
| parent | c727b7173ddd2a9f617275d5876e73dddb880543 (diff) | |
improve abi include directory for ndk
| -rw-r--r-- | xmake/platforms/android/load.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/platforms/android/load.lua b/xmake/platforms/android/load.lua index 1575ee4f9..f4e913503 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.translate(format("%s/sources/cxx-stl/llvm-libc++abi", ndk)) + local before_r13 = path.translate(path.join(abi_path, "libcxxabi")) + local after_r13 = path.translate(path.join(abi_path, "include")) + if os.isdir(before_r13) then + platform:add("cxxflags", format("-I%s",before_r13)) + elseif os.isdir(after_r13) then + platform:add("cxxflags", format("-I%s",after_r13)) + end + end end end end |
