summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/rules/qt/env/xmake.lua18
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)
+