Skip to content

Commit c215a0e

Browse files
committed
(rules) fix startwiths => startswith for platform.windows.subsystem rule
1 parent 9ecfe9b commit c215a0e

File tree

1 file changed

+5
-3
lines changed
  • xmake/rules/platform/windows/subsystem

1 file changed

+5
-3
lines changed

xmake/rules/platform/windows/subsystem/xmake.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,21 @@ rule("platform.windows.subsystem")
3131
if subsystem then
3232
local valid = false
3333
for _, s in ipairs(subsystems) do
34-
if subsystem:upper():startwiths(s) then
34+
if subsystem:upper():startswith(s) then
3535
valid = true
3636
break
3737
end
3838
end
3939
assert(valid, "Invalid subsystem " .. subsystem)
4040

41-
if target:has_tool("ld", "clang") then
41+
if target:has_tool("ld", "clang", "clangxx", "clang-cl") then
4242
target:add("ldflags", "-Wl,-subsystem:" .. subsystem, { force = true })
4343
elseif target:has_tool("ld", "link", "lld-link") then
4444
target:add("ldflags", "/SUBSYSTEM:" .. upper(subsystem), { force = true })
45-
elseif target:has_tool("ld", "gcc", "g++") then
45+
elseif target:has_tool("ld", "gcc", "gxx") then
4646
target:add("ldflags", "-Wl,-m" .. subsystem, { force = true })
47+
elseif target:has_tool("ld", "lld") then
48+
target:add("ldflags", "-subsystem:" .. subsystem, { force = true })
4749
elseif target:has_tool("ld", "ld") then
4850
target:add("ldflags", "-m" .. subsystem, { force = true })
4951
end

0 commit comments

Comments
 (0)