diff options
| -rw-r--r-- | xmake/rules/platform/windows/subsystem/xmake.lua | 8 |
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 |
