diff options
| -rw-r--r-- | xmake/modules/detect/sdks/find_qt.lua | 18 |
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 |
