summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/armcc.lua
diff options
context:
space:
mode:
authoras564335sa <[email protected]>2022-08-20 15:19:37 +0800
committeras564335sa <[email protected]>2022-08-20 15:19:37 +0800
commit50b293a58c8cbbc7c432ab3728c2c159f5d3bc18 (patch)
treeb2327f5d3ead65cf7b253ccbd5439b1fea9dc9a7 /xmake/modules/core/tools/armcc.lua
parent9accd1da89561c8695fec341a0c61768112953e5 (diff)
Support for incremental compilation and parse header file deps for keil/armcc
Diffstat (limited to 'xmake/modules/core/tools/armcc.lua')
-rw-r--r--xmake/modules/core/tools/armcc.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/armcc.lua b/xmake/modules/core/tools/armcc.lua
index 403e143f0..d9f504eea 100644
--- a/xmake/modules/core/tools/armcc.lua
+++ b/xmake/modules/core/tools/armcc.lua
@@ -131,9 +131,20 @@ function compile(self, sourcefile, objectfile, dependinfo, flags)
os.mkdir(path.directory(objectfile))
-- compile it
+ local depfile = dependinfo and os.tmpfile() or nil
try
{
function ()
+ -- support '--depend',I don't know how to get it,it is not implemented
+ -- if depfile and _g._HAS_MMD_MF == nil then
+ -- _g._HAS_MMD_MF = self:has_flags({"--depend", os.nuldev()}, "cxflags", { flagskey = "--depend" }) or false
+ -- end
+ _g._HAS_MMD_MF = true
+ -- -- generate includes file
+ local compflags = flags
+ if depfile and _g._HAS_MMD_MF then
+ compflags = table.join(compflags, "--depend", depfile)
+ end
local outdata, errdata = os.iorunv(compargv(self, sourcefile, objectfile, flags))
return (outdata or "") .. (errdata or "")
end,
@@ -175,6 +186,16 @@ function compile(self, sourcefile, objectfile, dependinfo, flags)
end
cprint("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n'))
end
+
+ -- generate the dependent includes
+ if depfile and os.isfile(depfile) then
+ if dependinfo then
+ dependinfo.depfiles_armcc = io.readfile(depfile, {continuation = "\\"})
+ end
+
+ -- remove the temporary dependent file
+ os.tryrm(depfile)
+ end
end
}
}