diff options
| author | ruki <[email protected]> | 2020-03-12 00:33:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-03-11 21:23:30 +0800 |
| commit | ffdc3aec032bf2490020287ff7afc32fd6df9729 (patch) | |
| tree | 0622a46aa3ef91ac0e75914fe9d58ac603678d52 /xmake/modules/private/action/build/object.lua | |
| parent | fd44c0fef3ed3bab58d27bb28da5884f9dc7945d (diff) | |
fix build object
Diffstat (limited to 'xmake/modules/private/action/build/object.lua')
| -rw-r--r-- | xmake/modules/private/action/build/object.lua | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/xmake/modules/private/action/build/object.lua b/xmake/modules/private/action/build/object.lua index 5a87bf825..1f57c8b37 100644 --- a/xmake/modules/private/action/build/object.lua +++ b/xmake/modules/private/action/build/object.lua @@ -84,18 +84,7 @@ function _do_build_file(target, sourcefile, opt) end -- build object -function _build_object(target, sourcebatch, index, opt) - - -- get the object and source with the given index - local sourcefile = sourcebatch.sourcefiles[index] - local objectfile = sourcebatch.objectfiles[index] - local dependfile = sourcebatch.dependfiles[index] - local sourcekind = assert(sourcebatch.sourcekind, "%s: sourcekind not found!", sourcefile) - - -- init build option - opt.objectfile = objectfile - opt.dependfile = dependfile - opt.sourcekind = sourcekind +function _build_object(target, sourcebatch, opt) -- do before build local before_build_file = target:script("build_file_before") @@ -122,8 +111,12 @@ end function main(target, batchjobs, sourcebatch, opt) local rootjob = opt.rootjob for i = 1, #sourcebatch.sourcefiles do - batchjobs:addjob(tostring(i), function (index, total) - _build_object(target, sourcebatch, i, {progress = (index * 100) / total}) + 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) + batchjobs:addjob(sourcefile, function (index, total) + _build_object(target, sourcebatch, {objectfile = objectfile, dependfile = dependfile, sourcekind = sourcekind, progress = (index * 100) / total}) end, rootjob) end end |
