summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstar9029 <[email protected]>2023-12-31 16:08:32 +0800
committerstar9029 <[email protected]>2023-12-31 16:08:32 +0800
commit21729b8a9abd072d992e2cb1d046ea0c50534673 (patch)
treef8a996f1133f5f43218c31decafe081016c5d8fb
parent59052f6aa1f980e1ae7b2da4b930250382fa25f9 (diff)
improve xmake.lua
-rw-r--r--xmake/rules/platform/windows/def/xmake.lua15
1 files changed, 10 insertions, 5 deletions
diff --git a/xmake/rules/platform/windows/def/xmake.lua b/xmake/rules/platform/windows/def/xmake.lua
index d796402cd..3ff6415ed 100644
--- a/xmake/rules/platform/windows/def/xmake.lua
+++ b/xmake/rules/platform/windows/def/xmake.lua
@@ -26,13 +26,18 @@ rule("platform.windows.def")
return
end
- local sourcebatch = target:sourcebatches()["platform.windows.def"]
- if sourcebatch then
- for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
- if target:is_plat("windows") then
+ if target:is_plat("windows") and target:has_tool("sh", "link") then
+ local sourcebatch = target:sourcebatches()["platform.windows.def"]
+ if sourcebatch then
+ for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
target:add("shflags", "/def:" .. path.translate(sourcefile), {force = true})
break;
- elseif target:is_plat("mingw") then
+ end
+ end
+ elseif target:is_plat("mingw") then
+ local sourcebatch = target:sourcebatches()["platform.windows.def"]
+ if sourcebatch then
+ for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
target:add("shflags", path.translate(sourcefile), {force = true})
break;
end