diff options
| author | ruki <[email protected]> | 2018-05-03 00:45:16 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-05-02 22:31:37 +0800 |
| commit | ef7975a6a99237a6543658ded2fb39d0669a1cac (patch) | |
| tree | 94b131486acab2369ec965befa349edb4f59e600 | |
| parent | d0c6a54322501d397e2b7f99fab40768deb38cf3 (diff) | |
set windows subsystem for windows qt
| -rw-r--r-- | xmake/rules/qt/xmake.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/rules/qt/xmake.lua b/xmake/rules/qt/xmake.lua index d5cb92f2e..abd4e9667 100644 --- a/xmake/rules/qt/xmake.lua +++ b/xmake/rules/qt/xmake.lua @@ -248,6 +248,17 @@ rule("qt.application") -- on load on_load(function (target) + + -- load common flags to target import("load")(target, {kind = "binary", frameworks = {"QtGui", "QtQml", "QtNetwork", "QtCore"}}) + + -- 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("defines", "_WINDOWS") + target:add("ldflags", "-Wl,-subsystem:windows", "-Wl,-entry:mainCRTStartup", {force = true}) + end end) |
