Skip to content

fix(find_qt): gracefully handle unsupported -qtconf argument#6528

Merged
waruqi merged 1 commit into
xmake-io:devfrom
Doekin:find_qt
Jun 7, 2025
Merged

fix(find_qt): gracefully handle unsupported -qtconf argument#6528
waruqi merged 1 commit into
xmake-io:devfrom
Doekin:find_qt

Conversation

@Doekin
Copy link
Copy Markdown
Contributor

@Doekin Doekin commented Jun 6, 2025

No description provided.

Comment thread xmake/modules/detect/sdks/find_qt.lua Outdated
local envs = {}
local run_args = {"-query"}
if sdkdir then
local qmake_help = os.iorunv(qmake, {"-help"})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if qmake not found or no qt env, os.iorunv will break.

Comment thread xmake/modules/detect/sdks/find_qt.lua Outdated
if os.isfile(conf_path) then
table.join2(run_args, {"-qtconf", conf_path})
break
local qmake_help = try {function () return os.iorunv(qmake, {"-help"}) end}
Copy link
Copy Markdown
Member

@waruqi waruqi Jun 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这会导致每次查找,qmake 都会被执行两次,影响性能。

应该是直接尝试带 -qtconf 执行,如果执行成功,也就一次,对于不常碰到的低版本,执行 -qtconf 失败,继续 fallback 执行第二次。

@Doekin Doekin changed the title fix(find_qt): validate -qtconf argument support before passing to qmake fix(find_qt): gracefully handle unsupported -qtconf argument Jun 6, 2025
@waruqi waruqi merged commit ca1d8f7 into xmake-io:dev Jun 7, 2025
21 of 22 checks passed
@waruqi waruqi added this to the v3.0.0 milestone Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants