diff options
| author | Doekin <[email protected]> | 2025-06-07 00:45:04 +0800 |
|---|---|---|
| committer | Doekin <[email protected]> | 2025-06-07 00:45:04 +0800 |
| commit | 5bfd1037e798369de9896cf792eab3b8191e9d6a (patch) | |
| tree | 15b495b1bfa1c507d620ef006d68a8f1a6b92c48 | |
| parent | 6989184ed0b7e61614d3f41bdbcdac4c6075ac77 (diff) | |
fix(find_qt): gracefully handle unsupported `-qtconf` argument
| -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) |
