diff options
| author | Arthur LAURENT <[email protected]> | 2022-08-05 05:38:34 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2022-08-05 05:38:34 +0200 |
| commit | 08bf176c09948d0a9662ca72b804e42e90ad341d (patch) | |
| tree | e53e1f0f7777ea484e5f4b8072f0905ad8d40096 /xmake/rules/c++/modules/modules_support | |
| parent | 913fecaf3b83198105cd56d10156b1adbc901a7e (diff) | |
Remove incorrect usage of set_depcache
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/clang.lua | 15 | ||||
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/gcc.lua | 9 | ||||
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/msvc.lua | 9 |
3 files changed, 3 insertions, 30 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua index 90d74b654..2cc4b0bb4 100644 --- a/xmake/rules/c++/modules/modules_support/clang.lua +++ b/xmake/rules/c++/modules/modules_support/clang.lua @@ -141,7 +141,6 @@ function generate_stl_headerunits(target, batchcmds, headerunits, opt) -- build headerunits local projectdir = os.projectdir() local flags = {} - local bmifiles = {} local depmtime = 0 for i, headerunit in ipairs(headerunits) do local bmifile = path.join(stlcachedir, headerunit.name .. get_bmi_extension()) @@ -152,11 +151,9 @@ function generate_stl_headerunits(target, batchcmds, headerunits, opt) end table.insert(flags, modulefileflag .. bmifile) - table.insert(bmifiles, bmifile) depmtime = math.max(depmtime, os.mtime(bmifile)) end batchcmds:set_depmtime(depmtime) - batchcmds:set_depcache(target:dependfile(bmifiles)) return flags end @@ -177,7 +174,6 @@ function generate_user_headerunits(target, batchcmds, headerunits, opt) local objectfiles = {} local flags = {} local projectdir = os.projectdir() - local bmifiles = {} local depmtime = 0 for _, headerunit in ipairs(headerunits) do local file = path.relative(headerunit.path, target:scriptdir()) @@ -208,11 +204,9 @@ function generate_user_headerunits(target, batchcmds, headerunits, opt) batchcmds:add_depfiles(headerunit.path) table.insert(flags, modulefileflag .. bmifile) - table.insert(bmifiles, bmifile) depmtime = math.max(depmtime, os.mtime(bmifile)) end batchcmds:set_depmtime(depmtime) - batchcmds:set_depcache(target:dependfile(bmifiles)) return flags end @@ -238,7 +232,6 @@ function build_modules(target, batchcmds, objectfiles, modules, opt) -- build modules local common_args = {modulecachepathflag .. cachedir} - local bmifiles = {} local depmtime = 0 for _, objectfile in ipairs(objectfiles) do local m = modules[objectfile] @@ -247,13 +240,13 @@ function build_modules(target, batchcmds, objectfiles, modules, opt) local args = { emitmoduleinterfaceflag } local bmiflags = {} - local bmifiles_ = {} + local bmifiles = {} for name, provide in pairs(m.provides) do batchcmds:show_progress(opt.progress, "${color.build.object}generating.cxx.module.bmi %s", name) local bmifile = provide.bmi table.join2(args, { "-c", "-x", "c++-module", "--precompile", provide.sourcefile, "-o", bmifile }) - table.insert(bmifiles_, bmifile) + table.insert(bmifiles, bmifile) batchcmds:add_depfiles(provide.sourcefile) @@ -262,18 +255,16 @@ function build_modules(target, batchcmds, objectfiles, modules, opt) end batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), common_args, args)) - batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), common_args, bmifiles_, {"-c", "-o", objectfile})) + batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), common_args, bmifiles, {"-c", "-o", objectfile})) target:add("cxxflags", bmiflags, {public = true, force = true}) target:add("objectfiles", objectfile) for _, f in ipairs(bmiflags) do target:data_add("cxx.modules.flags", f) end - table.join2(bmifiles, bmifiles_) end end batchcmds:set_depmtime(depmtime) - batchcmds:set_depcache(target:dependfile(bmifiles)) end function get_bmi_extension() diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua index 700e92210..ee4013d3e 100644 --- a/xmake/rules/c++/modules/modules_support/gcc.lua +++ b/xmake/rules/c++/modules/modules_support/gcc.lua @@ -159,7 +159,6 @@ function generate_stl_headerunits(target, batchcmds, headerunits, opt) -- build headerunits local projectdir = os.projectdir() - local bmifiles = {} local depmtime = 0 for i, headerunit in ipairs(headerunits) do local bmifile = path.join(stlcachedir, headerunit.name .. get_bmi_extension()) @@ -169,11 +168,9 @@ function generate_stl_headerunits(target, batchcmds, headerunits, opt) 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 - table.insert(bmifiles, bmifile) depmtime = math.max(depmtime, os.mtime(bmifile)) end batchcmds:set_depmtime(depmtime) - batchcmds:set_depcache(target:dependfile(bmifiles)) end -- generate target user header units @@ -186,7 +183,6 @@ function generate_user_headerunits(target, batchcmds, headerunits, opt) -- build headerunits local projectdir = os.projectdir() - local bmifiles = {} local depmtime = 0 for _, headerunit in ipairs(headerunits) do local file = path.relative(headerunit.path, projectdir) @@ -221,11 +217,9 @@ function generate_user_headerunits(target, batchcmds, headerunits, opt) batchcmds:add_depfiles(headerunit.path) end - table.insert(bmifiles, bmifile) depmtime = math.max(depmtime, os.mtime(bmifile)) end batchcmds:set_depmtime(depmtime) - batchcmds:set_depcache(target:dependfile(bmifiles)) end -- build module files @@ -239,7 +233,6 @@ function build_modules(target, batchcmds, objectfiles, modules, opt) -- build modules local projectdir = os.projectdir() - local bmifiles = {} local depmtime = 0 for _, objectfile in ipairs(objectfiles) do local m = modules[objectfile] @@ -256,7 +249,6 @@ function build_modules(target, batchcmds, objectfiles, modules, opt) batchcmds:add_depfiles(provide.sourcefile) end - table.insert(bmifiles, bmifile) depmtime = math.max(depmtime, os.mtime(bmifile)) end @@ -266,7 +258,6 @@ function build_modules(target, batchcmds, objectfiles, modules, opt) end end batchcmds:set_depmtime(depmtime) - batchcmds:set_depcache(target:dependfile(bmifiles)) end function get_bmi_extension() diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua index 22dc4485f..f3437eeab 100644 --- a/xmake/rules/c++/modules/modules_support/msvc.lua +++ b/xmake/rules/c++/modules/modules_support/msvc.lua @@ -129,7 +129,6 @@ function generate_stl_headerunits(target, batchcmds, headerunits, opt) local common_args = {"/TP", exportheaderflag, "/c"} local objectfiles = {} local flags = {} - local bmifiles = {} local depmtime = 0 for _, headerunit in ipairs(headerunits) do local bmifile = path.join(stlcachedir, headerunit.name .. get_bmi_extension()) @@ -142,11 +141,9 @@ function generate_stl_headerunits(target, batchcmds, headerunits, opt) local flag = {headerunitflag .. ":angle", headerunit.name .. "=" .. headerunit.name .. get_bmi_extension()} table.join2(flags, flag) - table.insert(bmifiles, bmifile) depmtime = math.max(depmtime, os.mtime(bmifile)) end batchcmds:set_depmtime(depmtime) - batchcmds:set_depcache(target:dependfile(bmifiles)) return flags end @@ -171,7 +168,6 @@ function generate_user_headerunits(target, batchcmds, headerunits, opt) local objectfiles = {} local flags = {} local projectdir = os.projectdir() - local bmifiles = {} local depmtime = 0 for _, headerunit in ipairs(headerunits) do local file = path.relative(headerunit.path, target:scriptdir()) @@ -199,11 +195,9 @@ function generate_user_headerunits(target, batchcmds, headerunits, opt) table.join2(flags, flag) target:add("objectfiles", objectfile) - table.insert(bmifiles, bmifile) depmtime = math.max(depmtime, os.mtime(bmifile)) end batchcmds:set_depmtime(depmtime) - batchcmds:set_depcache(target:dependfile(bmifiles)) return flags end @@ -230,7 +224,6 @@ function build_modules(target, batchcmds, objectfiles, modules, opt) -- build modules local common_args = {"/TP"} - local bmifiles = {} local depmtime = 0 for _, objectfile in ipairs(objectfiles) do local m = modules[objectfile] @@ -248,7 +241,6 @@ function build_modules(target, batchcmds, objectfiles, modules, opt) batchcmds:add_depfiles(provide.sourcefile) table.join2(bmiflags, {referenceflag, name .. "=" .. path.filename(bmifile)}) - table.insert(bmifiles, bmifile) depmtime = math.max(depmtime, os.mtime(bmifile)) end @@ -262,7 +254,6 @@ function build_modules(target, batchcmds, objectfiles, modules, opt) end end batchcmds:set_depmtime(depmtime) - batchcmds:set_depcache(target:dependfile(bmifiles)) end function get_bmi_extension() |
