Skip to content

Commit

Permalink
Merge pull request #5804 from Elite-stay/patch-2
Browse files Browse the repository at this point in the history
Improve user experience
  • Loading branch information
waruqi authored Nov 10, 2024
2 parents 59c56e8 + b644871 commit bfaaf9c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions xmake/modules/detect/sdks/find_qt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,27 @@ end
-- get qt environment
function _get_qtenvs(qmake)
local envs = {}
local results = try {function () return os.iorunv(qmake, {"-query"}) end}
local results = try {
function ()
return os.iorunv(qmake, {"-query"})
end,
catch {
function (errors)
if errors then
dprint(tostring(errors))
end
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
return envs
end
return envs
end

-- find qt sdk toolchains
Expand Down

0 comments on commit bfaaf9c

Please # to comment.