diff options
| author | ruki <[email protected]> | 2025-11-06 10:46:11 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-11-06 10:46:11 +0800 |
| commit | 12f9fb3c6b097f51329e2dcce0b2136b5235d323 (patch) | |
| tree | 42d3648d448f3463589f782d52ead6df0773f8ae | |
| parent | 169c7ddce5a07c82b5aa60fbc6fcb37e4593fb7d (diff) | |
| parent | 73b739597727ca6e0d4335f4e58b1dc7bf1018db (diff) | |
Merge pull request #6992 from Arthapz/add-missing-platforms
fix(modules) add all supported platforms for clang get_cpp_library_name
| -rw-r--r-- | xmake/rules/c++/modules/support.lua | 17 |
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" |
