summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
}
}