diff options
| author | Chan Lee <[email protected]> | 2025-01-22 17:25:06 +0800 |
|---|---|---|
| committer | Chan Lee <[email protected]> | 2025-01-22 17:25:06 +0800 |
| commit | bb89dfcc8a32c401b2208ce9c1f8a1862bb5a574 (patch) | |
| tree | 82f71a4c2cfc0343660297ac199fd2b7bc2e61a6 /xmake/rules/qt/ui | |
| parent | c61d7bb40353b161da913bdcbc6fa399e36164a1 (diff) | |
Add `qt_host` option to enable cross-platform Qt Builds using host SDK tools
Diffstat (limited to 'xmake/rules/qt/ui')
| -rw-r--r-- | xmake/rules/qt/ui/xmake.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xmake/rules/qt/ui/xmake.lua b/xmake/rules/qt/ui/xmake.lua index b4f769050..2fdeb79f6 100644 --- a/xmake/rules/qt/ui/xmake.lua +++ b/xmake/rules/qt/ui/xmake.lua @@ -22,16 +22,16 @@ rule("qt.ui") add_deps("qt.env") set_extensions(".ui") on_config(function (target) + import("lib.detect.find_file") -- get uic local qt = assert(target:data("qt"), "Qt not found!") - local uic = path.join(qt.bindir, is_host("windows") and "uic.exe" or "uic") - if not os.isexec(uic) and qt.libexecdir then - uic = path.join(qt.libexecdir, is_host("windows") and "uic.exe" or "uic") - end - if not os.isexec(uic) and qt.libexecdir_host then - uic = path.join(qt.libexecdir_host, is_host("windows") and "uic.exe" or "uic") - 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 + 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 uic = find_file(is_host("windows") and "uic.exe" or "uic", search_dirs) assert(uic and os.isexec(uic), "uic not found!") -- add includedirs, @note we need to create this directory first to suppress warning (file not found). |
