summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-06-07 23:25:38 +0800
committerGitHub <[email protected]>2025-06-07 23:25:38 +0800
commitca1d8f7cf03d0e7e4cb58ac23e5b56a5c334494c (patch)
tree59407e7c769d9909f874540c19b79de41d983dff
parent976fcf8c2a672ca8abf8eae54497c2b1f7d75142 (diff)
parent5bfd1037e798369de9896cf792eab3b8191e9d6a (diff)
Merge pull request #6528 from Doekin/find_qt
fix(find_qt): gracefully handle unsupported `-qtconf` argument
-rw-r--r--xmake/modules/detect/sdks/find_qt.lua12
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)