From 1fb045a19472a8d04d24cb41c49a3bf75b2767d2 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 8 Aug 2022 22:40:44 +0800 Subject: add batchjobs for gcc --- xmake/rules/c++/modules/xmake.lua | 47 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'xmake/rules/c++/modules/xmake.lua') diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index 4117004cc..3efa123e6 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -53,35 +53,34 @@ rule("c++.build.modules.builder") set_sourcekinds("cxx") set_extensions(".mpp", ".mxx", ".cppm", ".ixx") - -- TODO parallel build support to accelerate `xmake build` to build modules - --[[ - before_build_files(function(target, batchjobs, sourcebatch, opt) - if not target:data("cxx.has_modules") then - sourcebatch.objectfiles = {} - return + before_build(function(target, batchjobs, opt) + local job + if target:data("cxx.has_modules") then + import("modules_support.common") + local sourcebatch = target:sourcebatches()["c++.build.modules.builder"] + common.patch_sourcebatch(target, sourcebatch, opt) + + -- generate headerunits + local modules = common.get_module_dependencies(target, sourcebatch, opt) + batchjobs:group_enter(target:name() .. "/generate_headerunits") + common.generate_headerunits_for_batchjobs(target, batchjobs, sourcebatch, modules, opt) + job = batchjobs:group_leave() end + return job or opt.rootjob + end, {batch = true}) - -- patch sourcebatch - import("modules_support.common") - common.patch_sourcebatch(target, sourcebatch, opt) - - -- generate dependencies - local modules = common.generate_dependencies(target, sourcebatch, opt) - - -- generate headerunits - local headerunits_flags = common.generate_headerunits_for_batchjobs(target, batchjobs, sourcebatch, modules, opt) - if headerunits_flags then - target:add("cxxflags", headerunits_flags, {force = true, expand = false}) + -- parallel build support to accelerate `xmake build` to build modules + before_build_files(function(target, batchjobs, sourcebatch, opt) + if target:data("cxx.has_modules") then + import("modules_support.common") + local modules = common.get_module_dependencies(target, sourcebatch, opt) + common.build_modules_for_batchjobs(target, batchjobs, sourcebatch, modules, opt) end - - -- build modules - common.build_modules_for_batchjobs(target, batchjobs, sourcebatch, modules, opt) - end, {batch = true})]] + end, {batch = true}) -- serial compilation only, usually used to support project generator before_buildcmd_files(function(target, batchcmds, sourcebatch, opt) if not target:data("cxx.has_modules") then - sourcebatch.objectfiles = {} return end @@ -89,8 +88,8 @@ rule("c++.build.modules.builder") import("modules_support.common") common.patch_sourcebatch(target, sourcebatch, opt) - -- generate dependencies - local modules = common.generate_dependencies(target, sourcebatch, opt) + -- get module dependencies + local modules = common.get_module_dependencies(target, sourcebatch, opt) -- generate headerunits common.generate_headerunits_for_batchcmds(target, batchcmds, sourcebatch, modules, opt) -- cgit v1.3.1 From e96c32a19877939a4e325bb3afccef873b47ce35 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 8 Aug 2022 22:45:38 +0800 Subject: fix batchjobs for gcc/headerunits --- xmake/rules/c++/modules/modules_support/common.lua | 3 ++- xmake/rules/c++/modules/modules_support/gcc.lua | 23 ++++++++++++++++------ xmake/rules/c++/modules/xmake.lua | 1 + 3 files changed, 20 insertions(+), 7 deletions(-) (limited to 'xmake/rules/c++/modules/xmake.lua') diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua index e9ef0fb62..52a428874 100644 --- a/xmake/rules/c++/modules/modules_support/common.lua +++ b/xmake/rules/c++/modules/modules_support/common.lua @@ -416,6 +416,7 @@ function get_module_dependencies(target, sourcebatch, opt) local modules = _g.modules if modules == nil then modules = localcache():get("modules") + opt.progress = opt.progress or 0 local changed = modules_support(target).generate_dependencies(target, sourcebatch, opt) if changed or modules == nil then local moduleinfos = load_moduleinfos(target, sourcebatch) @@ -470,7 +471,7 @@ end -- build modules for batchjobs function build_modules_for_batchjobs(target, batchjobs, sourcebatch, modules, opt) local objectfiles = sort_modules_by_dependencies(sourcebatch.objectfiles, modules) --- modules_support(target).build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, opt) + modules_support(target).build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, opt) end -- build modules for batchcmds diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua index 663e4ea07..af328b0b2 100644 --- a/xmake/rules/c++/modules/modules_support/gcc.lua +++ b/xmake/rules/c++/modules/modules_support/gcc.lua @@ -171,10 +171,10 @@ function generate_stl_headerunits_for_batchjobs(target, batchjobs, headerunits, progress.show((index * 100) / total, "${color.build.object}generating.cxx.headerunit.bmi %s", headerunit.name) local args = {"-c", "-x", "c++-system-header", headerunit.name} os.vrunv(compinst:program(), table.join(compinst:compflags({target = target}), args)) - _add_module_to_mapper(mapper_file, headerunit.path, path.absolute(bmifile, projectdir)) end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}}) end, {rootjob = opt.rootjob}) end + _add_module_to_mapper(mapper_file, headerunit.path, path.absolute(bmifile, projectdir)) end end @@ -213,6 +213,13 @@ function generate_user_headerunits_for_batchjobs(target, batchjobs, headerunits, for _, headerunit in ipairs(headerunits) do local bmifilename = path.basename(objectfile) .. get_bmi_extension() local bmifile = (outputdir and path.join(outputdir, bmifilename) or bmifilename) + local headerunit_path + if headerunit.type == ":quote" then + headerunit_path = path.join(".", path.relative(headerunit.path, projectdir)) + elseif headerunit.type == ":angle" then + -- if path is relative then its a subtarget path + headerunit_path = path.is_absolute(headerunit.path) and headerunit.path or path.join(".", headerunit.path) + end batchjobs:addjob(headerunit.name, function (index, total) depend.on_changed(function() progress.show((index * 100) / total, "${color.build.object}generating.cxx.headerunit.bmi %s", headerunit.name) @@ -234,20 +241,16 @@ function generate_user_headerunits_for_batchjobs(target, batchjobs, headerunits, -- generate headerunit local args = { "-c" } - local headerunit_path if headerunit.type == ":quote" then table.join2(args, { "-I", path.directory(path.relative(headerunit.path, projectdir)), "-x", "c++-user-header", headerunit.name }) - headerunit_path = path.join(".", path.relative(headerunit.path, projectdir)) elseif headerunit.type == ":angle" then table.join2(args, { "-x", "c++-system-header", headerunit.name }) - -- if path is relative then its a subtarget path - headerunit_path = path.is_absolute(headerunit.path) and headerunit.path or path.join(".", headerunit.path) end os.vrunv(compinst:program(), table.join(compinst:compflags({target = target}), args)) - _add_module_to_mapper(mapper_file, headerunit_path, path.absolute(bmifile, projectdir)) end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}}) end, {rootjob = opt.rootjob}) + _add_module_to_mapper(mapper_file, headerunit_path, path.absolute(bmifile, projectdir)) end end @@ -296,6 +299,14 @@ function generate_user_headerunits_for_batchcmds(target, batchcmds, headerunits, batchcmds:set_depmtime(depmtime) end +-- build module files for batchjobs +function build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, opt) + batchjobs:addjob("TODO", function (index, total) + -- TODO + raise("build modules not supported!") + end, {rootjob = opt.rootjob}) +end + -- build module files for batchcmds function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, opt) local compinst = target:compiler("cxx") diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index 3efa123e6..c888a83fb 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -52,6 +52,7 @@ rule("c++.build.modules") rule("c++.build.modules.builder") set_sourcekinds("cxx") set_extensions(".mpp", ".mxx", ".cppm", ".ixx") + add_deps("c++.build.modules.dependencies") before_build(function(target, batchjobs, opt) local job -- cgit v1.3.1 From aaa5b2c37ec355cf2746f2d854517b3f43afcaf5 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 8 Aug 2022 22:46:26 +0800 Subject: remvoe deps --- xmake/rules/c++/modules/xmake.lua | 1 - 1 file changed, 1 deletion(-) (limited to 'xmake/rules/c++/modules/xmake.lua') diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index c888a83fb..3efa123e6 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -52,7 +52,6 @@ rule("c++.build.modules") rule("c++.build.modules.builder") set_sourcekinds("cxx") set_extensions(".mpp", ".mxx", ".cppm", ".ixx") - add_deps("c++.build.modules.dependencies") before_build(function(target, batchjobs, opt) local job -- cgit v1.3.1 From 4abd6737364ffec07d9813c63d89e0ae90240315 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 8 Aug 2022 22:46:33 +0800 Subject: add comments --- xmake/rules/c++/modules/xmake.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'xmake/rules/c++/modules/xmake.lua') diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index 3efa123e6..1d117e78b 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -53,6 +53,7 @@ rule("c++.build.modules.builder") set_sourcekinds("cxx") set_extensions(".mpp", ".mxx", ".cppm", ".ixx") + -- parallel build support to accelerate `xmake build` to build headerunits before_build(function(target, batchjobs, opt) local job if target:data("cxx.has_modules") then -- cgit v1.3.1 From d0e4316018f9d75742b26b3abf75860d129c31c8 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 8 Aug 2022 23:24:30 +0800 Subject: remove cxx sourcekind for modules --- xmake/rules/c++/modules/xmake.lua | 1 - 1 file changed, 1 deletion(-) (limited to 'xmake/rules/c++/modules/xmake.lua') diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index 1d117e78b..7048ec49b 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -50,7 +50,6 @@ rule("c++.build.modules") -- build modules rule("c++.build.modules.builder") - set_sourcekinds("cxx") set_extensions(".mpp", ".mxx", ".cppm", ".ixx") -- parallel build support to accelerate `xmake build` to build headerunits -- cgit v1.3.1 From ad67a37fe4981f68c52ae1e7497090a60a30edab Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 8 Aug 2022 23:31:35 +0800 Subject: fix module dpes --- xmake/rules/c++/modules/modules_support/common.lua | 9 +++---- xmake/rules/c++/modules/xmake.lua | 28 ++++++++++++---------- 2 files changed, 20 insertions(+), 17 deletions(-) (limited to 'xmake/rules/c++/modules/xmake.lua') diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua index 52a428874..ee1016d68 100644 --- a/xmake/rules/c++/modules/modules_support/common.lua +++ b/xmake/rules/c++/modules/modules_support/common.lua @@ -413,18 +413,19 @@ end -- get module dependencies function get_module_dependencies(target, sourcebatch, opt) - local modules = _g.modules + local cachekey = target:name() .. "/" .. sourcebatch.rulename + local modules = memcache():get2("modules", cachekey) if modules == nil then - modules = localcache():get("modules") + modules = localcache():get2("modules", cachekey) opt.progress = opt.progress or 0 local changed = modules_support(target).generate_dependencies(target, sourcebatch, opt) if changed or modules == nil then local moduleinfos = load_moduleinfos(target, sourcebatch) modules = parse_dependency_data(target, moduleinfos) - localcache():set("modules", modules) + localcache():set2("modules", cachekey, modules) localcache():save() end - _g.modules = modules + memcache():set2("modules", cachekey, modules) end return modules end diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index 7048ec49b..3c69600bd 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -50,6 +50,7 @@ rule("c++.build.modules") -- build modules rule("c++.build.modules.builder") + set_sourcekinds("cxx") set_extensions(".mpp", ".mxx", ".cppm", ".ixx") -- parallel build support to accelerate `xmake build` to build headerunits @@ -75,27 +76,28 @@ rule("c++.build.modules.builder") import("modules_support.common") local modules = common.get_module_dependencies(target, sourcebatch, opt) common.build_modules_for_batchjobs(target, batchjobs, sourcebatch, modules, opt) + else + sourcebatch.objectfiles = {} end end, {batch = true}) -- serial compilation only, usually used to support project generator before_buildcmd_files(function(target, batchcmds, sourcebatch, opt) - if not target:data("cxx.has_modules") then - return - end - - -- patch sourcebatch - import("modules_support.common") - common.patch_sourcebatch(target, sourcebatch, opt) + if target:data("cxx.has_modules") then + import("modules_support.common") - -- get module dependencies - local modules = common.get_module_dependencies(target, sourcebatch, opt) + -- patch sourcebatch + common.patch_sourcebatch(target, sourcebatch, opt) - -- generate headerunits - common.generate_headerunits_for_batchcmds(target, batchcmds, sourcebatch, modules, opt) + -- generate headerunits + local modules = common.get_module_dependencies(target, sourcebatch, opt) + common.generate_headerunits_for_batchcmds(target, batchcmds, sourcebatch, modules, opt) - -- build modules - common.build_modules_for_batchcmds(target, batchcmds, sourcebatch, modules, opt) + -- build modules + common.build_modules_for_batchcmds(target, batchcmds, sourcebatch, modules, opt) + else + sourcebatch.objectfiles = {} + end end) before_link(function(target) -- cgit v1.3.1 From 969c1371fde82493d75766681c800107b8359981 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 8 Aug 2022 23:31:54 +0800 Subject: add comments --- xmake/rules/c++/modules/xmake.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xmake/rules/c++/modules/xmake.lua') diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index 3c69600bd..42c1709b4 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -77,6 +77,7 @@ rule("c++.build.modules.builder") local modules = common.get_module_dependencies(target, sourcebatch, opt) common.build_modules_for_batchjobs(target, batchjobs, sourcebatch, modules, opt) else + -- avoid duplicate linking of object files of non-module programs sourcebatch.objectfiles = {} end end, {batch = true}) @@ -96,6 +97,7 @@ rule("c++.build.modules.builder") -- build modules common.build_modules_for_batchcmds(target, batchcmds, sourcebatch, modules, opt) else + -- avoid duplicate linking of object files of non-module programs sourcebatch.objectfiles = {} end end) -- cgit v1.3.1 From bd1263aa60a502120e06eb3fd077d69c689dc5d7 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 9 Aug 2022 00:27:34 +0800 Subject: build batchjobs modules for gcc --- xmake/rules/c++/modules/modules_support/common.lua | 41 ++++++++++++++++ xmake/rules/c++/modules/modules_support/gcc.lua | 55 +++++++++++++++++++--- xmake/rules/c++/modules/xmake.lua | 5 +- 3 files changed, 93 insertions(+), 8 deletions(-) (limited to 'xmake/rules/c++/modules/xmake.lua') diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua index ee1016d68..31ab47a81 100644 --- a/xmake/rules/c++/modules/modules_support/common.lua +++ b/xmake/rules/c++/modules/modules_support/common.lua @@ -469,6 +469,46 @@ function generate_headerunits_for_batchcmds(target, batchcmds, sourcebatch, modu end end +-- build batch jobs for module dependencies +function _build_batchjobs_for_moduledeps(modules, batchjobs, rootjob, jobrefs, moduleinfo) + local targetjob_ref = jobrefs[moduleinfo.name] + if targetjob_ref then + batchjobs:add(targetjob_ref, rootjob) + else + local modulejob = batchjobs:add(moduleinfo.job, rootjob) + if modulejob then + jobrefs[moduleinfo.name] = modulejob + for _, depname in ipairs(moduleinfo.deps) do + local dep = modules[depname] + if dep then -- maybe nil, e.g. `import ;` + _build_batchjobs_for_moduledeps(modules, batchjobs, modulejob, jobrefs, dep) + end + end + end + end +end + +-- build batchjobs for modules +function build_batchjobs_for_modules(modules, batchjobs, rootjob) + local depset = hashset.new() + for _, moduleinfo in pairs(modules) do + assert(moduleinfo.job) + for _, depname in ipairs(moduleinfo.deps) do + depset:insert(depname) + end + end + local modules_root = {} + for _, moduleinfo in pairs(modules) do + if not depset:has(moduleinfo.name) then + table.insert(modules_root, moduleinfo) + end + end + local jobrefs = {} + for _, moduleinfo in pairs(modules_root) do + _build_batchjobs_for_moduledeps(modules, batchjobs, rootjob, jobrefs, moduleinfo) + end +end + -- build modules for batchjobs function build_modules_for_batchjobs(target, batchjobs, sourcebatch, modules, opt) local objectfiles = sort_modules_by_dependencies(sourcebatch.objectfiles, modules) @@ -481,6 +521,7 @@ function build_modules_for_batchcmds(target, batchcmds, sourcebatch, modules, op modules_support(target).build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, opt) end +-- append headerunits objectfiles to link function append_headerunits_objectfiles(target) local cache = localcache():get("headerunit_objectfiles") or {} if target:is_binary() then diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua index 8f3bacf72..e62721cf3 100644 --- a/xmake/rules/c++/modules/modules_support/gcc.lua +++ b/xmake/rules/c++/modules/modules_support/gcc.lua @@ -299,10 +299,55 @@ end -- build module files for batchjobs function build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, opt) - batchjobs:addjob("TODO", function (index, total) - -- TODO - raise("build modules not supported!") - end, {rootjob = opt.rootjob}) + local compinst = target:compiler("cxx") + local mapper_file = _get_module_mapper() + local common_args = {"-x", "c++"} + local cachedir = common.modules_cachedir(target) + + -- build modules + local projectdir = os.projectdir() + local depmtime = 0 + local provided_modules = {} + for _, objectfile in ipairs(objectfiles) do + local m = modules[objectfile] + if m and m.provides then + -- assume there that provides is only one, until we encounter the case + local length = 0 + local name, provide + for k, v in pairs(m.provides) do + length = length + 1 + name = k + provide = v + if length > 1 then + raise("multiple provides are not supported now!") + end + end + + local bmifile = provide.bmi + local moduleinfo = table.copy(provide) + moduleinfo.job = batchjobs:newjob(provide.sourcefile, function (index, total) + depend.on_changed(function() + local args = {"-o", objectfile, "-c", provide.sourcefile} + progress.show((index * 100) / total, "${color.build.object}generating.cxx.module.bmi %s", name) + local objectdir = path.directory(objectfile) + if not os.isdir(objectdir) then + os.mkdir(objectdir) + end + os.vrunv(compinst:program(), table.join(compinst:compflags({target = target}), common_args, args)) + end, {dependfile = target:dependfile(bmifile), files = {provide.sourcefile}}) + end) + if m.requires then + moduleinfo.deps = table.keys(m.requires) + end + moduleinfo.name = name + provided_modules[name] = moduleinfo + _add_module_to_mapper(mapper_file, name, path.absolute(bmifile, projectdir)) + target:add("objectfiles", objectfile) + end + end + + -- build batchjobs for modules + common.build_batchjobs_for_modules(provided_modules, batchjobs, opt.rootjob) end -- build module files for batchcmds @@ -310,8 +355,6 @@ function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, op local compinst = target:compiler("cxx") local mapper_file = _get_module_mapper() local common_args = {"-x", "c++"} - - -- get cachedirs local cachedir = common.modules_cachedir(target) -- build modules diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index 42c1709b4..d6098b95e 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -53,6 +53,7 @@ rule("c++.build.modules.builder") set_sourcekinds("cxx") set_extensions(".mpp", ".mxx", ".cppm", ".ixx") + -- generate headerunits -- parallel build support to accelerate `xmake build` to build headerunits before_build(function(target, batchjobs, opt) local job @@ -60,8 +61,6 @@ rule("c++.build.modules.builder") import("modules_support.common") local sourcebatch = target:sourcebatches()["c++.build.modules.builder"] common.patch_sourcebatch(target, sourcebatch, opt) - - -- generate headerunits local modules = common.get_module_dependencies(target, sourcebatch, opt) batchjobs:group_enter(target:name() .. "/generate_headerunits") common.generate_headerunits_for_batchjobs(target, batchjobs, sourcebatch, modules, opt) @@ -70,10 +69,12 @@ rule("c++.build.modules.builder") return job or opt.rootjob end, {batch = true}) + -- build modules -- parallel build support to accelerate `xmake build` to build modules before_build_files(function(target, batchjobs, sourcebatch, opt) if target:data("cxx.has_modules") then import("modules_support.common") + common.patch_sourcebatch(target, sourcebatch, opt) local modules = common.get_module_dependencies(target, sourcebatch, opt) common.build_modules_for_batchjobs(target, batchjobs, sourcebatch, modules, opt) else -- cgit v1.3.1 From 1c039fcf27683545adb20ca316d42b1123282719 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 9 Aug 2022 22:35:50 +0800 Subject: clean module caches --- xmake/rules/c++/modules/xmake.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'xmake/rules/c++/modules/xmake.lua') diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index d6098b95e..23f9a0f77 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -103,11 +103,22 @@ rule("c++.build.modules.builder") end end) - before_link(function(target) + before_link(function (target) import("modules_support.common") common.append_headerunits_objectfiles(target) end) + after_clean(function (target) + import("core.base.option") + import("modules_support.common") + os.tryrm(common.modules_cachedir(target)) + if option.get("all") then + os.tryrm(common.stlmodules_cachedir(target)) + common.localcache():clear() + common.localcache():save() + end + end) + -- install modules rule("c++.build.modules.install") set_extensions(".mpp", ".mxx", ".cppm", ".ixx") -- cgit v1.3.1