diff options
| author | Arthur LAURENT <[email protected]> | 2022-07-11 22:35:32 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2022-07-11 22:35:32 +0200 |
| commit | 53dc46224c8288b422335e1db0c3ae941c504f54 (patch) | |
| tree | edf10f83b82619d3fa45090035c5c0ebc6dfce27 | |
| parent | 380591173f252275df68fc33d08404d2ecc7d166 (diff) | |
Add user flag and qmldir variable for deployqt script
| -rw-r--r-- | xmake/rules/qt/deploy/android.lua | 7 | ||||
| -rw-r--r-- | xmake/rules/qt/deploy/macosx.lua | 25 | ||||
| -rw-r--r-- | xmake/rules/qt/install/windows.lua | 25 |
3 files changed, 43 insertions, 14 deletions
diff --git a/xmake/rules/qt/deploy/android.lua b/xmake/rules/qt/deploy/android.lua index c5bc810c4..5e6a641d8 100644 --- a/xmake/rules/qt/deploy/android.lua +++ b/xmake/rules/qt/deploy/android.lua @@ -216,6 +216,13 @@ function main(target, opt) if option.get("verbose") and option.get("diagnosis") then table.insert(argv, "--verbose") end + + -- add user flags + local user_flags = target:values("qt.deploy.flags") or {} + if user_flags then + table.join(argv, user_flags) + end + os.vrunv(androiddeployqt, argv) -- output apk diff --git a/xmake/rules/qt/deploy/macosx.lua b/xmake/rules/qt/deploy/macosx.lua index 26df10b14..65a246a90 100644 --- a/xmake/rules/qt/deploy/macosx.lua +++ b/xmake/rules/qt/deploy/macosx.lua @@ -103,16 +103,20 @@ function main(target, opt) _save_info_plist(target, path.join(target_contents, "Info.plist")) -- find qml directory - local qmldir = nil - for _, sourcebatch in pairs(target:sourcebatches()) do - if sourcebatch.rulename == "qt.qrc" then - for _, sourcefile in ipairs(sourcebatch.sourcefiles) do - qmldir = find_path("*.qml", path.directory(sourcefile)) - if qmldir then - break + local qmldir = target:values("qt.deploy.qmldir") or nil + if not qmldir then + for _, sourcebatch in pairs(target:sourcebatches()) do + if sourcebatch.rulename == "qt.qrc" then + for _, sourcefile in ipairs(sourcebatch.sourcefiles) do + qmldir = find_path("*.qml", path.directory(sourcefile)) + if qmldir then + break + end end end end + else + qmldir = path.join(target:scriptdir(), qmldir) end -- do deploy @@ -132,6 +136,13 @@ function main(target, opt) -- e.g. "Apple Development: [email protected] (T3NA4MRVPU)" table.insert(argv, "-codesign=" .. codesign_identity) end + + -- add user flags + local user_flags = target:values("qt.deploy.flags") or {} + if user_flags then + table.join(argv, user_flags) + end + os.vrunv(macdeployqt, argv) -- update files and values to the dependent file diff --git a/xmake/rules/qt/install/windows.lua b/xmake/rules/qt/install/windows.lua index 69d4c1c70..bcd01cc35 100644 --- a/xmake/rules/qt/install/windows.lua +++ b/xmake/rules/qt/install/windows.lua @@ -38,16 +38,20 @@ function main(target, opt) assert(os.isexec(windeployqt), "windeployqt.exe not found!") -- find qml directory - local qmldir = nil - for _, sourcebatch in pairs(target:sourcebatches()) do - if sourcebatch.rulename == "qt.qrc" then - for _, sourcefile in ipairs(sourcebatch.sourcefiles) do - qmldir = find_path("*.qml", path.directory(sourcefile)) - if qmldir then - break + local qmldir = target:values("qt.deploy.qmldir") or nil + if not qmldir then + for _, sourcebatch in pairs(target:sourcebatches()) do + if sourcebatch.rulename == "qt.qrc" then + for _, sourcefile in ipairs(sourcebatch.sourcefiles) do + qmldir = find_path("*.qml", path.directory(sourcefile)) + if qmldir then + break + end end end end + else + qmldir = path.join(target:scriptdir(), qmldir) end -- find msvc to set VCINSTALLDIR env @@ -78,6 +82,13 @@ function main(target, opt) if qmldir then table.insert(argv, "--qmldir=" .. qmldir) end + + -- add user flags + local user_flags = target:values("qt.deploy.flags") or {} + if user_flags then + table.join(argv, user_flags) + end + table.insert(argv, installfile) os.vrunv(windeployqt, argv, {envs = envs}) |
