Skip to content

Commit

Permalink
fix winsdk error
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Dec 2, 2024
1 parent c736671 commit ed5c11f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions xmake/rules/winsdk/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -48,16 +45,16 @@ 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

-- add links
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)

2 comments on commit ed5c11f

@ifarbod
Copy link
Contributor

@ifarbod ifarbod commented on ed5c11f Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get an error when compiling, tools == "link" should be tools = "link" (?)

@waruqi
Copy link
Member Author

@waruqi waruqi commented on ed5c11f Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try it again.

Please sign in to comment.