summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-12-02 22:47:14 +0800
committerruki <[email protected]>2024-12-02 22:47:14 +0800
commited5c11f035b660a6e97cb47202614a3881090d3a (patch)
tree867cd7ddd04d93f10f4a8121685ad378e6786b28
parentc736671feca48bcce183401a4ac96fddb77895b7 (diff)
fix winsdk error
-rw-r--r--xmake/rules/winsdk/xmake.lua9
1 files changed, 3 insertions, 6 deletions
diff --git a/xmake/rules/winsdk/xmake.lua b/xmake/rules/winsdk/xmake.lua
index 60be1ce08..1c049731a 100644
--- a/xmake/rules/winsdk/xmake.lua
+++ b/xmake/rules/winsdk/xmake.lua
@@ -25,13 +25,10 @@ rule("win.sdk.resource")
-- define rule: application
rule("win.sdk.application")
-
- -- before load
on_load(function (target)
target:set("kind", "binary")
end)
- -- after load
after_load(function (target)
-- set subsystem: windows
@@ -48,8 +45,8 @@ rule("win.sdk.application")
end
end
end
- if not subsystem and target:has_tool("ld", "link") then
- target:add("ldflags", "-subsystem:windows", {force = true})
+ if not subsystem then
+ target:add("ldflags", "-subsystem:windows", {force = true, tools == "link"})
end
end
@@ -57,7 +54,7 @@ rule("win.sdk.application")
target:add("syslinks", "kernel32", "user32", "gdi32", "winspool", "comdlg32", "advapi32")
target:add("syslinks", "shell32", "ole32", "oleaut32", "uuid", "odbc32", "odbccp32", "comctl32")
target:add("syslinks", "comdlg32", "setupapi", "shlwapi")
- if not is_plat("mingw") then
+ if not target:is_plat("mingw") then
target:add("syslinks", "strsafe")
end
end)