improve abi include directory for ndk
@@ -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
