diff options
| author | ruki <[email protected]> | 2019-09-08 22:21:18 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-09-08 22:21:18 +0800 |
| commit | 533b7ae2ee168d2be5f3df249712da0d9b141e40 (patch) | |
| tree | 51b3b4ada5f65aad07d43fc413a54c593cffec56 /xmake/rules/qt/load.lua | |
| parent | 678cfdda5d012e74f10a83e305844c90980349f1 (diff) | |
improve qt.load
Diffstat (limited to 'xmake/rules/qt/load.lua')
| -rw-r--r-- | xmake/rules/qt/load.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/rules/qt/load.lua b/xmake/rules/qt/load.lua index 3abe3245a..6d24f2472 100644 --- a/xmake/rules/qt/load.lua +++ b/xmake/rules/qt/load.lua @@ -212,5 +212,16 @@ function main(target, opt) -- add some static third-party links if exists target:add("links", _find_static_links(qt.linkdirs, is_plat("windows") and "qt*.lib" or "libqt*.a")) + + -- is gui application? + if opt.gui then + -- add -subsystem:windows for windows platform + if is_plat("windows") then + target:add("defines", "_WINDOWS") + target:add("ldflags", "-subsystem:windows", "-entry:mainCRTStartup", {force = true}) + elseif is_plat("mingw") then + target:add("ldflags", "-Wl,-subsystem:windows", {force = true}) + end + end end |
