summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-03-14 00:39:50 +0800
committerruki <[email protected]>2020-03-13 21:59:00 +0800
commita23b2000a2675f005b6a60b3c2bd0a5917970fb8 (patch)
treed4ad92214586b0746b890886d87b3b3601def5cc
parent130ef6ca26cf5d29c5e69a2b486ca69c98c3bf6d (diff)
fix pass object opt
-rw-r--r--xmake/modules/private/action/build/object.lua17
1 files changed, 9 insertions, 8 deletions
diff --git a/xmake/modules/private/action/build/object.lua b/xmake/modules/private/action/build/object.lua
index 4f953384c..ab1e96a40 100644
--- a/xmake/modules/private/action/build/object.lua
+++ b/xmake/modules/private/action/build/object.lua
@@ -95,10 +95,10 @@ end
function build(target, sourcebatch, opt)
for i = 1, #sourcebatch.sourcefiles do
local sourcefile = sourcebatch.sourcefiles[i]
- local objectfile = sourcebatch.objectfiles[i]
- local dependfile = sourcebatch.dependfiles[i]
- local sourcekind = assert(sourcebatch.sourcekind, "%s: sourcekind not found!", sourcefile)
- _build_object(target, sourcefile, {objectfile = objectfile, dependfile = dependfile, sourcekind = sourcekind, progress = opt.progress})
+ opt.objectfile = sourcebatch.objectfiles[i]
+ opt.dependfile = sourcebatch.dependfiles[i]
+ opt.sourcekind = assert(sourcebatch.sourcekind, "%s: sourcekind not found!", sourcefile)
+ _build_object(target, sourcefile, opt)
end
end
@@ -107,11 +107,12 @@ function main(target, batchjobs, sourcebatch, opt)
local rootjob = opt.rootjob
for i = 1, #sourcebatch.sourcefiles do
local sourcefile = sourcebatch.sourcefiles[i]
- local objectfile = sourcebatch.objectfiles[i]
- local dependfile = sourcebatch.dependfiles[i]
- local sourcekind = assert(sourcebatch.sourcekind, "%s: sourcekind not found!", sourcefile)
+ opt.objectfile = sourcebatch.objectfiles[i]
+ opt.dependfile = sourcebatch.dependfiles[i]
+ opt.sourcekind = assert(sourcebatch.sourcekind, "%s: sourcekind not found!", sourcefile)
batchjobs:addjob(sourcefile, function (index, total)
- _build_object(target, sourcefile, {objectfile = objectfile, dependfile = dependfile, sourcekind = sourcekind, progress = (index * 100) / total})
+ opt.progress = (index * 100) / total
+ _build_object(target, sourcefile, opt)
end, rootjob)
end
end