summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/gcc.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2022-08-06 06:24:34 +0200
committerArthur LAURENT <[email protected]>2022-08-06 06:30:16 +0200
commit57ac4f46f10e8525d4a5dec0e6c4c19f1ac35ab7 (patch)
tree62bb082a332eb3f6443ee7f4ec56b029f773b926 /xmake/rules/c++/modules/modules_support/gcc.lua
parentb0379bcadce0b66fa5d3e5fc45d85a8ba365c92b (diff)
Implement module mapper file for MSVC
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/gcc.lua')
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc.lua40
1 files changed, 20 insertions, 20 deletions
diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua
index cf996bdea..e99e83ae9 100644
--- a/xmake/rules/c++/modules/modules_support/gcc.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc.lua
@@ -165,14 +165,14 @@ function generate_stl_headerunits_for_batchcmds(target, batchcmds, headerunits,
-- build headerunits
local projectdir = os.projectdir()
local depmtime = 0
- for i, headerunit in ipairs(headerunits) do
+ for _, headerunit in ipairs(headerunits) do
local bmifile = path.join(stlcachedir, headerunit.name .. get_bmi_extension())
- if _add_module_to_mapper(mapper_file, headerunit.path, path.absolute(bmifile, projectdir)) then
- local args = { "-c", "-x", "c++-system-header", headerunit.name }
+ local args = { "-c", "-x", "c++-system-header", headerunit.name }
- batchcmds:show_progress(opt.progress, "${color.build.object}generating.cxx.headerunit.bmi %s", headerunit.name)
- batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), args))
- end
+ batchcmds:show_progress(opt.progress, "${color.build.object}generating.cxx.headerunit.bmi %s", headerunit.name)
+ batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), args))
+
+ _add_module_to_mapper(mapper_file, headerunit.path, path.absolute(bmifile, projectdir))
depmtime = math.max(depmtime, os.mtime(bmifile))
end
batchcmds:set_depmtime(depmtime)
@@ -216,11 +216,11 @@ function generate_user_headerunits_for_batchcmds(target, batchcmds, headerunits,
headerunit_path = path.is_absolute(headerunit.path) and headerunit.path or path.join(".", headerunit.path)
end
- if _add_module_to_mapper(mapper_file, headerunit_path, path.absolute(bmifile, projectdir)) then
- batchcmds:show_progress(opt.progress, "${color.build.object}generating.cxx.headerunit.bmi %s", headerunit.name)
- batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), args))
- batchcmds:add_depfiles(headerunit.path)
- end
+ batchcmds:show_progress(opt.progress, "${color.build.object}generating.cxx.headerunit.bmi %s", headerunit.name)
+ batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), args))
+ batchcmds:add_depfiles(headerunit.path)
+
+ _add_module_to_mapper(mapper_file, headerunit_path, path.absolute(bmifile, projectdir))
depmtime = math.max(depmtime, os.mtime(bmifile))
end
batchcmds:set_depmtime(depmtime)
@@ -254,16 +254,16 @@ function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, op
end
local bmifile = provide.bmi
- if _add_module_to_mapper(mapper_file, name, path.absolute(bmifile, projectdir)) then
- local args = {"-o", objectfile, "-c", provide.sourcefile}
- batchcmds:show_progress(opt.progress, "${color.build.object}generating.cxx.module.bmi %s", name)
- batchcmds:mkdir(path.directory(objectfile))
- batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), common_args, args))
- batchcmds:add_depfiles(provide.sourcefile)
+ local args = {"-o", objectfile, "-c", provide.sourcefile}
+ batchcmds:show_progress(opt.progress, "${color.build.object}generating.cxx.module.bmi %s", name)
+ batchcmds:mkdir(path.directory(objectfile))
+ batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), common_args, args))
+ batchcmds:add_depfiles(provide.sourcefile)
- target:add("objectfiles", objectfile)
- depmtime = math.max(depmtime, os.mtime(bmifile))
- end
+ _add_module_to_mapper(mapper_file, name, path.absolute(bmifile, projectdir))
+
+ target:add("objectfiles", objectfile)
+ depmtime = math.max(depmtime, os.mtime(bmifile))
end
end
batchcmds:set_depmtime(depmtime)