summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/gcc.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2022-08-07 03:44:36 +0200
committerArthur LAURENT <[email protected]>2022-08-07 03:44:36 +0200
commit823ea42a24ad71abc284c118e1534b5d229c5a5b (patch)
tree3c1216423682e4097156936fb089f2c3087806c7 /xmake/rules/c++/modules/modules_support/gcc.lua
parentc3adbbb8bf99185329511029b09483df2308eb59 (diff)
Build stl header units only when not present and add dummy append_headerunits_objectfiles function
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/gcc.lua')
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc.lua13
1 files changed, 9 insertions, 4 deletions
diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua
index e99e83ae9..7f3d94dc9 100644
--- a/xmake/rules/c++/modules/modules_support/gcc.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc.lua
@@ -167,10 +167,11 @@ function generate_stl_headerunits_for_batchcmds(target, batchcmds, headerunits,
local depmtime = 0
for _, headerunit in ipairs(headerunits) do
local bmifile = path.join(stlcachedir, headerunit.name .. get_bmi_extension())
- 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))
+ if not os.isfile(bmifile) then
+ 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
_add_module_to_mapper(mapper_file, headerunit.path, path.absolute(bmifile, projectdir))
depmtime = math.max(depmtime, os.mtime(bmifile))
@@ -334,3 +335,7 @@ function get_depoutputflag(target)
end
return depoutputflag or nil
end
+
+-- no .o generated by header units on GCC
+function append_headerunits_objectfiles(target)
+end \ No newline at end of file