diff options
| author | Arthur LAURENT <[email protected]> | 2025-05-12 15:55:34 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2025-05-12 15:55:34 +0200 |
| commit | c215a0e6b620229098ab2fe5ea9169809e2617e5 (patch) | |
| tree | 77ed339179cc00892c18967dd11a9687cbc27c2a | |
| parent | 9ecfe9b05e0891ea06f834b8ca75f2433504ce31 (diff) | |
(rules) fix startwiths => startswith for platform.windows.subsystem rule
| -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..f1de0b9e9 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 |
