summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-01-24 22:49:28 +0800
committerruki <[email protected]>2025-01-24 22:49:28 +0800
commit8a4e42c388159e2046a22f32c6551acb961ac586 (patch)
tree8df184198deb113eabf8c6d3dd1dd515fa8107c9
parent1f59ab2428339916eafc2bdc1350641cc1c4f6d3 (diff)
parse depsfile
-rw-r--r--xmake/modules/core/tools/cl6x.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/cl6x.lua b/xmake/modules/core/tools/cl6x.lua
index c2d272bb7..3224a76f0 100644
--- a/xmake/modules/core/tools/cl6x.lua
+++ b/xmake/modules/core/tools/cl6x.lua
@@ -139,11 +139,14 @@ end
-- compile the source file
function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
os.mkdir(path.directory(objectfile))
+ local depfile = dependinfo and os.tmpfile() or nil
try
{
function ()
-
local compflags = flags
+ if depfile then
+ compflags = table.join(compflags, "-ppd=" .. depfile)
+ end
local outdata, errdata = os.iorunv(compargv(self, sourcefile, objectfile, compflags))
return (outdata or "") .. (errdata or "")
end,
@@ -185,6 +188,16 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
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_gcc = io.readfile(depfile, {continuation = "\\"})
+ end
+
+ -- remove the temporary dependent file
+ os.tryrm(depfile)
+ end
end
}
}