summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
-rw-r--r--xmake/rules/c++/modules/modules_support/clang/builder.lua14
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc/builder.lua14
-rw-r--r--xmake/rules/c++/modules/modules_support/msvc/builder.lua14
3 files changed, 21 insertions, 21 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang/builder.lua b/xmake/rules/c++/modules/modules_support/clang/builder.lua
index 6c36feff6..f0b853b87 100644
--- a/xmake/rules/c++/modules/modules_support/clang/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/clang/builder.lua
@@ -204,7 +204,7 @@ function make_module_buildjobs(target, batchjobs, job_name, deps, opt)
name = job_name,
deps = table.join(target:name() .. "_populate_module_map", deps),
sourcefile = opt.cppfile,
- job = batchjobs:newjob(name or opt.cppfile, function(index, total)
+ job = batchjobs:newjob(name or opt.cppfile, function(index, total, jobopt)
local mapped_bmi
if provide and compiler_support.memcache():get2(target:name() .. name, "reuse") then
if not target:is_binary() then
@@ -252,18 +252,18 @@ function make_module_buildjobs(target, batchjobs, job_name, deps, opt)
local bmifile = mapped_bmi or bmifile
if target:is_binary() then
if mapped_bmi then
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.objectfile.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.objectfile.$(mode) %s", target:name(), name or opt.cppfile)
_compile_objectfile_step(target, bmifile, opt.cppfile, opt.objectfile)
else
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
_compile_one_step(target, bmifile, opt.cppfile, opt.objectfile, {std = (name == "std" or name == "std.compat")})
end
else
if (not public and not external) or (external and private_dep) then
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
_compile_one_step(target, bmifile, opt.cppfile, opt.objectfile, {std = (name == "std" or name == "std.compat")})
else
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.bmi.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.bmi.$(mode) %s", target:name(), name or opt.cppfile)
_compile_bmi_step(target, bmifile, opt.cppfile, {std = (name == "std" or name == "std.compat")})
end
end
@@ -352,7 +352,7 @@ function make_headerunit_buildjobs(target, job_name, batchjobs, headerunit, bmif
return {
name = job_name,
sourcefile = headerunit.path,
- job = batchjobs:newjob(job_name, function(index, total)
+ job = batchjobs:newjob(job_name, function(index, total, jobopt)
if not os.isdir(outputdir) then
os.mkdir(outputdir)
end
@@ -366,7 +366,7 @@ function make_headerunit_buildjobs(target, job_name, batchjobs, headerunit, bmif
local depvalues = {compinst:program(), compflags}
if opt.build then
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", target:name(), headerunit.name)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", target:name(), headerunit.name)
_compile(target, _make_headerunitflags(target, headerunit, bmifile), headerunit.path, bmifile)
end
diff --git a/xmake/rules/c++/modules/modules_support/gcc/builder.lua b/xmake/rules/c++/modules/modules_support/gcc/builder.lua
index 0c9b8c1b1..e2d6f95c5 100644
--- a/xmake/rules/c++/modules/modules_support/gcc/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc/builder.lua
@@ -183,7 +183,7 @@ function make_module_buildjobs(target, batchjobs, job_name, deps, opt)
name = job_name,
deps = table.join(target:name() .. "_populate_module_map", deps),
sourcefile = opt.cppfile,
- job = batchjobs:newjob(name or opt.cppfile, function(index, total)
+ job = batchjobs:newjob(name or opt.cppfile, function(index, total, jobopt)
local mapped_bmi
if provide and compiler_support.memcache():get2(target:name() .. name, "reuse") then
if not target:is_binary() then
@@ -220,18 +220,18 @@ function make_module_buildjobs(target, batchjobs, job_name, deps, opt)
local sourcefile
if target:is_binary() then
if mapped_bmi then
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.objectfile.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.objectfile.$(mode) %s", target:name(), name or opt.cppfile)
sourcefile = bmifile
else
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
sourcefile = opt.cppfile
end
else
if (not public and not external) or (external and private_dep) then
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
sourcefile = opt.cppfile
else
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.bmi.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.bmi.$(mode) %s", target:name(), name or opt.cppfile)
local module_onlyflag = compiler_support.get_moduleonlyflag(target)
table.insert(flags, module_onlyflag)
sourcefile = opt.cppfile
@@ -333,7 +333,7 @@ function make_headerunit_buildjobs(target, job_name, batchjobs, headerunit, bmif
return {
name = job_name,
sourcefile = headerunit.path,
- job = batchjobs:newjob(job_name, function(index, total)
+ job = batchjobs:newjob(job_name, function(index, total, jobopt)
if not os.isdir(outputdir) then
os.mkdir(outputdir)
end
@@ -348,7 +348,7 @@ function make_headerunit_buildjobs(target, job_name, batchjobs, headerunit, bmif
if opt.build then
local headerunit_mapper = _generate_headerunit_modulemapper_file({name = path.normalize(headerunit.path), bmifile = bmifile})
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", target:name(), headerunit.name)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", target:name(), headerunit.name)
if option.get("diagnosis") then
print("mapper file:\n%s", io.readfile(headerunit_mapper))
end
diff --git a/xmake/rules/c++/modules/modules_support/msvc/builder.lua b/xmake/rules/c++/modules/modules_support/msvc/builder.lua
index a46dae34a..5a67df409 100644
--- a/xmake/rules/c++/modules/modules_support/msvc/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/msvc/builder.lua
@@ -267,7 +267,7 @@ function make_module_buildjobs(target, batchjobs, job_name, deps, opt)
name = job_name,
deps = table.join(target:name() .. "_populate_module_map", deps),
sourcefile = opt.cppfile,
- job = batchjobs:newjob(name or opt.cppfile, function(index, total)
+ job = batchjobs:newjob(name or opt.cppfile, function(index, total, jobopt)
local mapped_bmi
if provide and compiler_support.memcache():get2(target:name() .. name, "reuse") then
@@ -316,18 +316,18 @@ function make_module_buildjobs(target, batchjobs, job_name, deps, opt)
local bmifile = mapped_bmi or bmifile
if target:is_binary() then
if mapped_bmi then
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.objectfile.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.objectfile.$(mode) %s", target:name(), name or opt.cppfile)
_compile_objectfile_step(target, bmifile, opt.cppfile, opt.objectfile, provide)
else
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
_compile_one_step(target, bmifile, opt.cppfile, opt.objectfile, provide)
end
else
if (not public and not external) or (external and private_dep) then
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.module.$(mode) %s", target:name(), name or opt.cppfile)
_compile_one_step(target, bmifile, opt.cppfile, opt.objectfile, provide)
else
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.bmi.$(mode) %s", target:name(), name or opt.cppfile)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.bmi.$(mode) %s", target:name(), name or opt.cppfile)
_compile_bmi_step(target, bmifile, opt.cppfile, opt.objectfile, provide)
end
end
@@ -416,7 +416,7 @@ function make_headerunit_buildjobs(target, job_name, batchjobs, headerunit, bmif
return {
name = job_name,
sourcefile = headerunit.path,
- job = batchjobs:newjob(job_name, function(index, total)
+ job = batchjobs:newjob(job_name, function(index, total, jobopt)
if not os.isdir(outputdir) then
os.mkdir(outputdir)
end
@@ -432,7 +432,7 @@ function make_headerunit_buildjobs(target, job_name, batchjobs, headerunit, bmif
local name = headerunit.unique and headerunit.name or headerunit.path
if opt.build then
- progress.show((index * 100) / total, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", target:name(), headerunit.name)
+ progress.show(jobopt.progress, "${color.build.target}<%s> ${clear}${color.build.object}compiling.headerunit.$(mode) %s", target:name(), headerunit.name)
_compile(target, _make_headerunitflags(target, headerunit, bmifile), name, target:objectfile(headerunit.path), true)
end