summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-04-28 23:24:54 +0800
committerruki <[email protected]>2023-04-28 23:24:54 +0800
commit63e4d08d20a935acf47ac86beb587e9261b78506 (patch)
treeb47d2a36de97e57957341d322b92ca8b85b78a6d
parentf853b312d7e6d2c9b3b035a4adf2779c9b77ea7e (diff)
fix find qt envs
-rw-r--r--xmake/modules/detect/sdks/find_qt.lua18
1 files changed, 7 insertions, 11 deletions
diff --git a/xmake/modules/detect/sdks/find_qt.lua b/xmake/modules/detect/sdks/find_qt.lua
index bd3ff97bf..581904450 100644
--- a/xmake/modules/detect/sdks/find_qt.lua
+++ b/xmake/modules/detect/sdks/find_qt.lua
@@ -176,19 +176,15 @@ end
-- get qt environment
function _get_qtenvs(qmake)
- local envs = _g._ENVS
- if not envs then
- envs = {}
- local results = try {function () return os.iorunv(qmake, {"-query"}) end}
- if results then
- for _, qtenv in ipairs(results:split('\n', {plain = true})) do
- local kv = qtenv:split(':', {plain = true, limit = 2}) -- @note set limit = 2 for supporting value with win-style path, e.g. `key:C:\xxx`
- if #kv == 2 then
- envs[kv[1]] = kv[2]:trim()
- end
+ local envs = {}
+ local results = try {function () return os.iorunv(qmake, {"-query"}) end}
+ if results then
+ for _, qtenv in ipairs(results:split('\n', {plain = true})) do
+ local kv = qtenv:split(':', {plain = true, limit = 2}) -- @note set limit = 2 for supporting value with win-style path, e.g. `key:C:\xxx`
+ if #kv == 2 then
+ envs[kv[1]] = kv[2]:trim()
end
end
- _g._ENVS = envs
end
return envs
end