diff options
Diffstat (limited to 'xmake/rules/qt/deploy')
| -rw-r--r-- | xmake/rules/qt/deploy/android.lua | 24 | ||||
| -rw-r--r-- | xmake/rules/qt/deploy/macosx.lua | 6 |
2 files changed, 17 insertions, 13 deletions
diff --git a/xmake/rules/qt/deploy/android.lua b/xmake/rules/qt/deploy/android.lua index 9299c61e0..524afe533 100644 --- a/xmake/rules/qt/deploy/android.lua +++ b/xmake/rules/qt/deploy/android.lua @@ -71,10 +71,10 @@ function main(target, opt) end -- get androiddeployqt - local androiddeployqt = path.join(qt.bindir, "androiddeployqt" .. (is_host("windows") and ".exe" or "")) - if not os.isexec(androiddeployqt) and qt.bindir_host then - androiddeployqt = path.join(qt.bindir_host, "androiddeployqt" .. (is_host("windows") and ".exe" or "")) - end + local search_dirs = {} + if qt.bindir_host then table.insert(search_dirs, qt.bindir_host) end + if qt.bindir then table.insert(search_dirs, qt.bindir) end + local androiddeployqt = find_file("androiddeployqt" .. (is_host("windows") and ".exe" or ""), search_dirs) assert(os.isexec(androiddeployqt), "androiddeployqt not found!") -- get working directory @@ -152,18 +152,18 @@ 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") - if not os.isexec(qmlimportscanner) and qt.libexecdir_host then - qmlimportscanner = path.join(qt.libexecdir_host, "qmlimportscanner") - end + local search_dirs = {} + if qt.libexecdir_host then table.insert(search_dirs, qt.libexecdir_host) end + if qt.libexecdir then table.insert(search_dirs, qt.libexecdir) end + local qmlimportscanner = find_file("qmlimportscanner" .. (is_host("windows") and ".exe" or ""), search_dirs) if os.isexec(qmlimportscanner) then settings_file:print(' "qml-importscanner-binary": "%s",', _escape_path(qmlimportscanner)) end -- for 6.3.x - local rcc = path.join(qt.bindir, "rcc") - if not os.isexec(rcc) and qt.bindir_host then - rcc = path.join(qt.bindir_host, "rcc") - end + local search_dirs = {} + if qt.bindir_host then table.insert(search_dirs, qt.bindir_host) end + if qt.bindir then table.insert(search_dirs, qt.bindir) end + local rcc = find_file("rcc" .. (is_host("windows") and ".exe" or ""), search_dirs) if os.isexec(rcc) then settings_file:print(' "rcc-binary": "%s",', _escape_path(rcc)) end diff --git a/xmake/rules/qt/deploy/macosx.lua b/xmake/rules/qt/deploy/macosx.lua index 7cc056099..a184647fb 100644 --- a/xmake/rules/qt/deploy/macosx.lua +++ b/xmake/rules/qt/deploy/macosx.lua @@ -24,6 +24,7 @@ import("core.base.option") import("core.project.config") import("core.project.depend") import("core.tool.toolchain") +import("lib.detect.find_file") import("lib.detect.find_path") import("detect.sdks.find_qt") import("utils.progress") @@ -91,7 +92,10 @@ function main(target, opt) local qt = assert(find_qt(), "Qt SDK not found!") -- get macdeployqt - local macdeployqt = path.join(qt.bindir, "macdeployqt") + local search_dirs = {} + if qt.bindir_host then table.insert(search_dirs, qt.bindir_host) end + if qt.bindir then table.insert(search_dirs, qt.bindir) end + local macdeployqt = find_file("macdeployqt" .. (is_host("windows") and ".exe" or ""), search_dirs) assert(os.isexec(macdeployqt), "macdeployqt not found!") -- generate target app |
