summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRC1844 <[email protected]>2025-06-25 09:31:17 +0800
committerGitHub <[email protected]>2025-06-25 09:31:17 +0800
commiteeb022205910c6f916aa955e9c77de8953e201f9 (patch)
tree43280f419517abaf945171c8bca62e0af0347a5f
parent821fb017575b8e2bbff260a9c29fa2f4a74991a6 (diff)
Update Qt ts rule
Replace the ts file update method to avoid the lupdate.exe command triggering the windows command line string limit
-rw-r--r--xmake/rules/qt/ts/xmake.lua16
1 files changed, 15 insertions, 1 deletions
diff --git a/xmake/rules/qt/ts/xmake.lua b/xmake/rules/qt/ts/xmake.lua
index 9f8a8e59c..9319fa2d4 100644
--- a/xmake/rules/qt/ts/xmake.lua
+++ b/xmake/rules/qt/ts/xmake.lua
@@ -4,22 +4,36 @@ rule("qt.ts")
on_config(function (target)
import("lib.detect.find_file")
+ import("core.base.json")
-- get source file
local lupdate_argv = {"-no-obsolete"}
local sourcefile_ts
+ local source_files = {}
for _, sourcebatch in pairs(target:sourcebatches()) do
if sourcebatch.rulename == "qt.ts" then
sourcefile_ts = sourcebatch.sourcefiles
else
if sourcebatch.sourcefiles then
for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
- table.join2(lupdate_argv, path(sourcefile))
+ table.insert(source_files, sourcefile)
end
end
end
end
if sourcefile_ts then
+ -- save source files
+ source_files = table.unique(source_files)
+ local json_data = {
+ projectFile = "",
+ sources = source_files
+ }
+
+ local json_path = path.join(target:autogendir(), "rules", "qt", "ts", "sources.json")
+ json.savefile(json_path, json_data)
+
+ table.join2(lupdate_argv, {"-project", path(json_path)})
+
-- get lupdate and lrelease
local qt = assert(target:data("qt"), "qt not found!")