diff options
| author | ruki <[email protected]> | 2022-05-19 22:31:14 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-19 22:31:14 +0800 |
| commit | 8b09757e778376392e242ffebdf5d29d88e1d0ea (patch) | |
| tree | 50e38b0da3dbacb38012a665b45f8788221836f8 | |
| parent | 3674a502ae48035813cac69525162d7a7f89ba28 (diff) | |
| parent | 29fe11a32173539feca184c65bae6ccb643f5c50 (diff) | |
Merge pull request #2366 from SirLynix/improve_qt
Improve Qt 6.3 support on Windows
| -rw-r--r-- | xmake/modules/detect/sdks/find_qt.lua | 22 | ||||
| -rw-r--r-- | xmake/rules/qt/deploy/android.lua | 6 |
2 files changed, 18 insertions, 10 deletions
diff --git a/xmake/modules/detect/sdks/find_qt.lua b/xmake/modules/detect/sdks/find_qt.lua index 202b52d88..f9acd68c7 100644 --- a/xmake/modules/detect/sdks/find_qt.lua +++ b/xmake/modules/detect/sdks/find_qt.lua @@ -114,17 +114,25 @@ function _find_sdkdir(sdkdir, sdkver) table.insert(paths, "~/Qt*") end + -- special case for android on windows, where qmake is a .bat from version 6.3 + if is_host("windows") and is_plat("android") then + local qmake = find_file("qmake.bat", paths, {suffixes = subdirs}) + if qmake then + return path.directory(path.directory(qmake)), path.filename(qmake) + end + end + -- attempt to find qmake local qmake = find_file(is_host("windows") and "qmake.exe" or "qmake", paths, {suffixes = subdirs}) if qmake then - return path.directory(path.directory(qmake)) + return path.directory(path.directory(qmake)), path.filename(qmake) end end -- find qmake function _find_qmake(sdkdir, sdkver) - sdkdir = _find_sdkdir(sdkdir, sdkver) - local qmake = find_tool("qmake", {paths = sdkdir and path.join(sdkdir, "bin")}) + local sdkdir, qmakefile = _find_sdkdir(sdkdir, sdkver) + local qmake = find_tool(qmakefile, {paths = sdkdir and path.join(sdkdir, "bin")}) if qmake then return qmake.program end @@ -175,8 +183,8 @@ function _find_qt(sdkdir, sdkver) local includedir = qtenvs.QT_INSTALL_HEADERS local mkspecsdir = qtenvs.QMAKE_MKSPECS or path.join(qtenvs.QT_INSTALL_ARCHDATA, "mkspecs") -- for 6.2 - local bindir_host - if libexecdir and is_plat("android", "iphoneos") then + local bindir_host = qtenvs.QT_HOST_BINS + if not bindir_host and libexecdir and is_plat("android", "iphoneos") then local rootdir = path.directory(path.directory(bindir)) if is_host("macosx") then bindir_host = path.join(rootdir, "macos", "bin") @@ -184,8 +192,8 @@ function _find_qt(sdkdir, sdkver) -- TODO end end - local libexecdir_host - if libexecdir and is_plat("android", "iphoneos") then + local libexecdir_host = qtenvs.QT_HOST_LIBEXECS + if not libexecdir_host and libexecdir and is_plat("android", "iphoneos") then local rootdir = path.directory(path.directory(libexecdir)) if is_host("macosx") then libexecdir_host = path.join(rootdir, "macos", "libexec") diff --git a/xmake/rules/qt/deploy/android.lua b/xmake/rules/qt/deploy/android.lua index 326addbc1..2677c6a49 100644 --- a/xmake/rules/qt/deploy/android.lua +++ b/xmake/rules/qt/deploy/android.lua @@ -151,12 +151,12 @@ function main(target, opt) settings_file:print(' "target-architecture": "%s",', target_arch) settings_file:print(' "qml-root-path": "%s",', _escape_path(os.projectdir())) -- for 6.2.x - local qmlimportscanner = path.join(qt.libexecdir, "qmlimportscanner" .. (is_host("windows") and ".exe" or "")) + local qmlimportscanner = path.join(qt.libexecdir, "qmlimportscanner") if not os.isexec(qmlimportscanner) and qt.libexecdir_host then - qmlimportscanner = path.join(qt.libexecdir_host, "qmlimportscanner" .. (is_host("windows") and ".exe" or "")) + qmlimportscanner = path.join(qt.libexecdir_host, "qmlimportscanner") end if os.isexec(qmlimportscanner) then - settings_file:print(' "qml-importscanner-binary": "%s",', qmlimportscanner) + settings_file:print(' "qml-importscanner-binary": "%s",', _escape_path(qmlimportscanner)) end local minsdkversion = target:values("qt.android.minsdkversion") if minsdkversion then |
