diff options
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/clang.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/clang.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua index 9f7e2225d..8cf54c883 100644 --- a/xmake/rules/c++/modules/modules_support/clang.lua +++ b/xmake/rules/c++/modules/modules_support/clang.lua @@ -247,7 +247,7 @@ function _build_modulefile(target, sourcefile, opt) local dependfile = opt.dependfile local compinst = compiler.load("cxx", {target = target}) local compflags = compinst:compflags({sourcefile = sourcefile, target = target}) - local dependinfo = option.get("rebuild") and {} or (depend.load(dependfile) or {}) + local dependinfo = target:is_rebuilt() and {} or (depend.load(dependfile) or {}) -- need build this object? local dryrun = option.get("dry-run") @@ -411,7 +411,7 @@ function generate_dependencies(target, sourcebatch, opt) end return {moduleinfo = rawdependinfo} - end, {dependfile = dependfile, files = {sourcefile}}) + end, {dependfile = dependfile, files = {sourcefile}, changed = target:is_rebuilt()}) end return changed end @@ -442,7 +442,8 @@ function generate_stl_headerunits_for_batchjobs(target, batchjobs, headerunits, os.vrunv(compinst:program(), table.join(compinst:compflags({target = target}), args)) end - end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}}) + end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}, changed = target:is_rebuilt()}) + -- libc++ have a builtin module mapper if not _use_stdlib(target, "libc++") then _add_module_to_mapper(target, headerunit.name, bmifile) @@ -523,7 +524,7 @@ function generate_user_headerunits_for_batchjobs(target, batchjobs, headerunits, end os.vrunv(compinst:program(), table.join(compinst:compflags({target = target}), args)) - end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}}) + end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}, changed = target:is_rebuilt()}) _add_module_to_mapper(target, headerunit.name, bmifile) end, {rootjob = flushjob}) end @@ -614,7 +615,7 @@ function build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, op progress.show(opt.progress, "${color.build.object}generating.module.metadata %s", name) local metadata = common.generate_meta_module_info(target, name, cppfile, module.requires) json.savefile(metafilepath, metadata) - end, {dependfile = target:dependfile(metafilepath), files = {cppfile}}) + end, {dependfile = target:dependfile(metafilepath), files = {cppfile}, changed = target:is_rebuilt()}) end, {rootjob = flushjob}) end end |
