summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-17 00:57:59 +0800
committerruki <[email protected]>2020-12-17 00:57:59 +0800
commit4c58aab66b51756f5b469a4fdbbaa645d51bb946 (patch)
tree546fead5bb7af1c813ae415705186d6a109cbcc2
parent70f4c91f86f69d721f79744466627f67c75bb242 (diff)
improve the build progress
-rw-r--r--xmake/actions/build/build.lua2
-rw-r--r--xmake/actions/build/build_files.lua2
-rw-r--r--xmake/modules/private/async/runjobs.lua5
3 files changed, 6 insertions, 3 deletions
diff --git a/xmake/actions/build/build.lua b/xmake/actions/build/build.lua
index 0e32dc847..65318e9fa 100644
--- a/xmake/actions/build/build.lua
+++ b/xmake/actions/build/build.lua
@@ -224,7 +224,7 @@ function main(targetname)
if errors and progress.showing_without_scroll() then
print("")
end
- end, curdir = curdir})
+ end, curdir = curdir, count_as_index = true})
os.cd(curdir)
end
end
diff --git a/xmake/actions/build/build_files.lua b/xmake/actions/build/build_files.lua
index c61596cd0..af83f79a0 100644
--- a/xmake/actions/build/build_files.lua
+++ b/xmake/actions/build/build_files.lua
@@ -206,7 +206,7 @@ function main(targetname, sourcefiles)
local batchjobs = _get_batchjobs(targetname, filepatterns)
if batchjobs and batchjobs:size() > 0 then
local curdir = os.curdir()
- runjobs("build_files", batchjobs, {comax = option.get("jobs") or 1, curdir = curdir})
+ runjobs("build_files", batchjobs, {comax = option.get("jobs") or 1, curdir = curdir, count_as_index = true})
os.cd(curdir)
end
end
diff --git a/xmake/modules/private/async/runjobs.lua b/xmake/modules/private/async/runjobs.lua
index 49c8e9115..98417f8ac 100644
--- a/xmake/modules/private/async/runjobs.lua
+++ b/xmake/modules/private/async/runjobs.lua
@@ -131,6 +131,8 @@ function main(name, jobs, opt)
-- run jobs
local index = 0
+ local count = 0
+ local count_as_index = opt.count_as_index
local priority_prev = 0
local priority_curr = 0
local job_pending = nil
@@ -185,7 +187,8 @@ function main(name, jobs, opt)
if opt.curdir then
os.cd(opt.curdir)
end
- jobfunc(i, total)
+ jobfunc(count_as_index and count or i, total)
+ count = count + 1
end
end,
catch