summaryrefslogtreecommitdiff
path: root/xmake/rules/winsdk/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-10 00:44:41 +0800
committerruki <[email protected]>2019-09-09 22:28:11 +0800
commitc58d64d433d2a3e2c97ead29738722aa653ae88a (patch)
treea4ca97893fe476aa99137796d1f630a9aa7e3f5f /xmake/rules/winsdk/xmake.lua
parent53cb6cf113e29f8dd17f51eb416e649c0e5f1f48 (diff)
add windemo
Diffstat (limited to 'xmake/rules/winsdk/xmake.lua')
-rw-r--r--xmake/rules/winsdk/xmake.lua31
1 files changed, 19 insertions, 12 deletions
diff --git a/xmake/rules/winsdk/xmake.lua b/xmake/rules/winsdk/xmake.lua
index 66accd6aa..e5190fc31 100644
--- a/xmake/rules/winsdk/xmake.lua
+++ b/xmake/rules/winsdk/xmake.lua
@@ -37,20 +37,27 @@ rule("win.sdk.application")
after_load(function (target)
-- set subsystem: windows
- local subsystem = false
- for _, ldflag in ipairs(target:get("ldflags")) do
- ldflag = ldflag:lower()
- if ldflag:find("[/%-]subsystem:") then
- subsystem = true
- break
+ if is_plat("mingw") then
+ target:add("ldflags", "-mwindows", {force = true})
+ else
+ local subsystem = false
+ for _, ldflag in ipairs(target:get("ldflags")) do
+ ldflag = ldflag:lower()
+ if ldflag:find("[/%-]subsystem:") then
+ subsystem = true
+ break
+ end
+ end
+ if not subsystem then
+ target:add("ldflags", "-subsystem:windows", {force = true})
end
- end
- if not subsystem then
- target:add("ldflags", "-subsystem:windows", {force = true})
end
-- add links
- target:add("links", "kernel32", "user32", "gdi32", "winspool", "comdlg32", "advapi32")
- target:add("links", "shell32", "ole32", "oleaut32", "uuid", "odbc32", "odbccp32", "comctl32")
- target:add("links", "cfgmgr32", "comdlg32", "setupapi", "strsafe", "shlwapi")
+ 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
+ target:add("syslinks", "strsafe")
+ end
end)