summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstar9029 <[email protected]>2023-12-31 01:20:18 +0800
committerstar9029 <[email protected]>2023-12-31 01:20:18 +0800
commit59052f6aa1f980e1ae7b2da4b930250382fa25f9 (patch)
tree4cd95bcb398c97d72b5ba8b49765be945e2c21dd
parentda3b723be857e3a2fe4e229265caf6246db1f0dd (diff)
support .def on mingw
-rw-r--r--xmake/rules/platform/windows/def/xmake.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/xmake/rules/platform/windows/def/xmake.lua b/xmake/rules/platform/windows/def/xmake.lua
index 545d61fd1..d796402cd 100644
--- a/xmake/rules/platform/windows/def/xmake.lua
+++ b/xmake/rules/platform/windows/def/xmake.lua
@@ -21,16 +21,20 @@
-- add *.def for windows/dll
rule("platform.windows.def")
set_extensions(".def")
- on_config("windows", function (target)
+ on_config("windows", "mingw", function (target)
if not target:is_shared() then
return
end
- if target:has_tool("sh", "link") then
- local sourcebatch = target:sourcebatches()["platform.windows.def"]
- if sourcebatch then
- for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
+
+ local sourcebatch = target:sourcebatches()["platform.windows.def"]
+ if sourcebatch then
+ for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
+ if target:is_plat("windows") then
target:add("shflags", "/def:" .. path.translate(sourcefile), {force = true})
break;
+ elseif target:is_plat("mingw") then
+ target:add("shflags", path.translate(sourcefile), {force = true})
+ break;
end
end
end