summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-05-12 22:00:10 +0800
committerGitHub <[email protected]>2025-05-12 22:00:10 +0800
commit9b1b539d087eff3e7b62ec700839e2beb7842ebc (patch)
tree02580649c205e52c52ad8aa77c8b410ab557bc4d
parent715b1767f84c804fcb30fbc79e4fe8cc212db534 (diff)
parent1c38e7509f7c155cdbdd203e277ddfb83d980a04 (diff)
Merge pull request #6426 from Arthapz/fix-subsystem-rule
(platform.windows.subsystem rules) fix startwiths => startswith
-rw-r--r--xmake/rules/platform/windows/subsystem/xmake.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/rules/platform/windows/subsystem/xmake.lua b/xmake/rules/platform/windows/subsystem/xmake.lua
index a1cc9138c..82b1b45fc 100644
--- a/xmake/rules/platform/windows/subsystem/xmake.lua
+++ b/xmake/rules/platform/windows/subsystem/xmake.lua
@@ -31,19 +31,21 @@ rule("platform.windows.subsystem")
if subsystem then
local valid = false
for _, s in ipairs(subsystems) do
- if subsystem:upper():startwiths(s) then
+ if subsystem:upper():startswith(s) then
valid = true
break
end
end
assert(valid, "Invalid subsystem " .. subsystem)
- if target:has_tool("ld", "clang") then
+ if target:has_tool("ld", "clang", "clangxx", "clang_cl") then
target:add("ldflags", "-Wl,-subsystem:" .. subsystem, { force = true })
elseif target:has_tool("ld", "link", "lld-link") then
target:add("ldflags", "/SUBSYSTEM:" .. upper(subsystem), { force = true })
- elseif target:has_tool("ld", "gcc", "g++") then
+ elseif target:has_tool("ld", "gcc", "gxx") then
target:add("ldflags", "-Wl,-m" .. subsystem, { force = true })
+ elseif target:has_tool("ld", "lld") then
+ target:add("ldflags", "-subsystem:" .. subsystem, { force = true })
elseif target:has_tool("ld", "ld") then
target:add("ldflags", "-m" .. subsystem, { force = true })
end