summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-04-01 23:53:06 +0800
committerruki <[email protected]>2024-04-01 23:53:06 +0800
commitd8c9790454b1de10f38f9334facea7f00d3ad332 (patch)
tree913d8dcde4262884f3b2d0d5ddc414f569adf006
parent37e6c3d9841445b95abd283f4f67c842584df214 (diff)
fix find qmake
-rw-r--r--xmake/modules/detect/sdks/find_qt.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/xmake/modules/detect/sdks/find_qt.lua b/xmake/modules/detect/sdks/find_qt.lua
index 41448deb3..5cb77f9ad 100644
--- a/xmake/modules/detect/sdks/find_qt.lua
+++ b/xmake/modules/detect/sdks/find_qt.lua
@@ -134,7 +134,19 @@ function _find_sdkdir(sdkdir, sdkver)
end
-- attempt to find qmake
- local qmake = find_file(is_host("windows") and "qmake.exe" or "qmake", paths, {suffixes = subdirs})
+ local qmake
+ if is_host("windows") then
+ qmake = find_file("qmake.exe", paths, {suffixes = subdirs})
+ else
+ -- @see https://github.com/xmake-io/xmake/issues/4881
+ if sdkver then
+ local major = sdkver:sub(1, 1)
+ qmake = find_file("qmake" .. major, paths, {suffixes = subdirs})
+ end
+ if not qmake then
+ qmake = find_file("qmake", paths, {suffixes = subdirs})
+ end
+ end
if qmake then
return path.directory(path.directory(qmake)), qmake
end