diff options
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/detect/sdks/find_qt.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xmake/modules/detect/sdks/find_qt.lua b/xmake/modules/detect/sdks/find_qt.lua index 29eb65e73..c1b526673 100644 --- a/xmake/modules/detect/sdks/find_qt.lua +++ b/xmake/modules/detect/sdks/find_qt.lua @@ -205,19 +205,23 @@ end -- get qt environment function _get_qtenvs(qmake, sdkdir) local envs = {} - local run_args = {"-query"} + local results + + -- Try with -qtconf first if sdkdir is provided if sdkdir then local conf_paths = {path.join(sdkdir, "bin", "target_qt.conf"), path.join(sdkdir, "bin", "qt.conf")} for _, conf_path in ipairs(conf_paths) do if os.isfile(conf_path) then - table.join2(run_args, {"-qtconf", conf_path}) + results = try {function () return os.iorunv(qmake, {"-query", "-qtconf", conf_path}) end} break end end end - local results = try { + + -- Fallback to normal query if sdkdir is not specified or -qtconf not applicable + results = results or try { function () - return os.iorunv(qmake, run_args) + return os.iorunv(qmake, {"-query"}) end, catch { function (errors) |
