Skip to content

Commit

Permalink
Update find_qt.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi authored Nov 8, 2024
1 parent fa34c04 commit b644871
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions xmake/modules/detect/sdks/find_qt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,18 @@ 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`
Expand All @@ -201,10 +212,6 @@ function _get_qtenvs(qmake)
end
end
return envs
else
if option.get("verbose") then
print("qmake -query failed")
end
end
end

Expand Down

0 comments on commit b644871

Please # to comment.