diff options
| author | ruki <[email protected]> | 2019-07-16 00:14:10 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-07-15 19:25:01 +0800 |
| commit | dd8f3463d7b5f6ff96c45ca71238a6ec699ff4f1 (patch) | |
| tree | 3dd5cffda2e01f78459e09089e22d33b2ce75302 | |
| parent | 893445dd37a571a7f33370b0970f046f30054b29 (diff) | |
improve qt runenvs to support vs plugin
| -rw-r--r-- | xmake/rules/qt/env/xmake.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/xmake/rules/qt/env/xmake.lua b/xmake/rules/qt/env/xmake.lua index 565bebf07..127203c5d 100644 --- a/xmake/rules/qt/env/xmake.lua +++ b/xmake/rules/qt/env/xmake.lua @@ -23,17 +23,19 @@ rule("qt.env") -- before load before_load(function (target) + + -- imports import("detect.sdks.find_qt") - if not target:data("qt") then - target:data_set("qt", assert(find_qt(nil, {verbose = true}), "Qt SDK not found!")) - end - end) - -- before run - before_run(function (target) + -- find qt sdk local qt = target:data("qt") - if qt and (is_plat("windows") or (is_plat("mingw") and is_host("windows"))) then - os.addenv("PATH", qt.bindir) + if not qt then + qt = assert(find_qt(nil, {verbose = true}), "Qt SDK not found!") + target:data_set("qt", qt) + end + if is_plat("windows") or (is_plat("mingw") and is_host("windows")) then + target:add("runenvs", "PATH", qt.bindir) end end) + |
