summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstar9029 <[email protected]>2025-07-21 15:01:43 +0800
committerGitHub <[email protected]>2025-07-21 15:01:43 +0800
commitf4b10ec248d670ad3e0a18eff044745f65aee34b (patch)
tree44c9bf2d1d7afe2b3333269fb9c38104338d8189
parent6694d5b11dd4740d1ff8a401f43574e85efd2076 (diff)
Support .def file with clang
-rw-r--r--xmake/rules/platform/windows/def/xmake.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/rules/platform/windows/def/xmake.lua b/xmake/rules/platform/windows/def/xmake.lua
index 00f795434..08279d90a 100644
--- a/xmake/rules/platform/windows/def/xmake.lua
+++ b/xmake/rules/platform/windows/def/xmake.lua
@@ -26,7 +26,7 @@ rule("platform.windows.def")
return
end
- if target:is_plat("windows") and (not target:has_tool("sh", "link")) then
+ if target:is_plat("windows") and (not target:has_tool("sh", "link", "clangxx")) then
return
end
@@ -36,6 +36,9 @@ rule("platform.windows.def")
local flag = path.translate(sourcefile)
if target:is_plat("windows") then
flag = "/def:" .. flag
+ if target:has_tool("sh", "clangxx") then
+ flag = "-Wl," .. flag
+ end
end
-- https://github.com/xmake-io/xmake/pull/4901
target:add("shflags", flag, {force = true})