summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/support.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-11-05 12:13:10 +0100
committerArthur LAURENT <[email protected]>2025-11-05 12:13:10 +0100
commit73b739597727ca6e0d4335f4e58b1dc7bf1018db (patch)
tree7296ad82d88f3407ed7bfdc2da32eeb56db9b320 /xmake/rules/c++/modules/support.lua
parentc5d08dcde1187fbf3903d51d63af8e15e28650c1 (diff)
(modules) add all supported platforms for clang get_cpp_library_name
Diffstat (limited to 'xmake/rules/c++/modules/support.lua')
-rw-r--r--xmake/rules/c++/modules/support.lua17
1 files changed, 14 insertions, 3 deletions
diff --git a/xmake/rules/c++/modules/support.lua b/xmake/rules/c++/modules/support.lua
index 0f89d4e98..700426e2c 100644
--- a/xmake/rules/c++/modules/support.lua
+++ b/xmake/rules/c++/modules/support.lua
@@ -21,6 +21,7 @@ import("core.base.bytes")
import("core.base.option")
import("core.base.json")
import("core.base.hashset")
+import("core.tool.toolchain")
import("core.cache.memcache", {alias = "_memcache"})
import("core.cache.localcache", {alias = "_localcache"})
import("async.runjobs")
@@ -73,15 +74,25 @@ function get_cpplibrary_name(target)
-- libc++ come first because on windows, if we use libc++ clang will still use msvc crt so MD / MT / MDd / MTd can be set
if target:has_runtime("c++_shared", "c++_static") then
return "c++"
- elseif target:has_runtime("stdc++_shared", "stdc++_static") then
+ elseif target:has_runtime("stdc++_shared", "stdc++_static", "gnustl_static", "gnustl_shared") then
return "stdc++"
+ elseif target:has_runtime("stlport_static", "stlport_shared") then
+ return "stlport"
elseif target:has_runtime("MD", "MT", "MDd", "MTd") then
return "msstl"
end
-- if no specified runtime, fallback on native platform C++ library
- if target:is_plat("macosx", "iphoneos", "appletvos") then
+ if target:is_plat("android") then
+ local ndk = toolchain.load("ndk", { plat = target:plat(), arch = target:arch() })
+ local ver = ndk:config("ndkver")
+ if not ver or ver > 14 then
+ return "c++"
+ else
+ return "stdc++"
+ end
+ elseif target:is_plat("macosx", "iphoneos", "watchos", "appletvos", "applexros", "bsd", "harmony") then
return "c++"
- elseif target:is_plat("linux") or target:is_plat("mingw") then
+ elseif target:is_plat("linux", "mingw", "cygwin", "msys", "haiku") then
return "stdc++"
elseif target:is_plat("windows") then
return "msstl"