diff options
| -rw-r--r-- | xmake/modules/private/action/build/object.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/private/async/runjobs.lua | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/xmake/modules/private/action/build/object.lua b/xmake/modules/private/action/build/object.lua index 1f57c8b37..2275945e1 100644 --- a/xmake/modules/private/action/build/object.lua +++ b/xmake/modules/private/action/build/object.lua @@ -84,7 +84,7 @@ function _do_build_file(target, sourcefile, opt) end -- build object -function _build_object(target, sourcebatch, opt) +function _build_object(target, sourcefile, opt) -- do before build local before_build_file = target:script("build_file_before") @@ -116,7 +116,7 @@ function main(target, batchjobs, sourcebatch, opt) 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}) + _build_object(target, sourcefile, {objectfile = objectfile, dependfile = dependfile, sourcekind = sourcekind, progress = (index * 100) / total}) end, rootjob) end end diff --git a/xmake/modules/private/async/runjobs.lua b/xmake/modules/private/async/runjobs.lua index 3a764dafc..2b848bde5 100644 --- a/xmake/modules/private/async/runjobs.lua +++ b/xmake/modules/private/async/runjobs.lua @@ -152,7 +152,13 @@ function main(name, jobs, opt) if not jobs_cb then -- get job priority - local job, priority = job_pending or jobs:pop() + local job, priority + if job_pending then + job = job_pending + priority = priority_prev + else + job, priority = jobs:pop() + end if not job then break end |
