summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-06-11 20:02:34 +0800
committerruki <[email protected]>2022-06-11 20:02:34 +0800
commitd6591287d047d23409d003a4ce68f7c75acb03a8 (patch)
treea9e8c35e8b9575f0319ee2bc02c834994787279c
parentd21eaafda4c5797df7b7ef6131349d2752ec9b01 (diff)
improve cl/ccache
-rw-r--r--xmake/modules/core/tools/cl.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index fdcce6d45..5969c3844 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -467,15 +467,16 @@ function _preprocess(program, argv, opt)
if not os.isdir(cppfiledir) then
os.mkdir(cppfiledir)
end
- table.insert(cppflags, "-P")
+ table.insert(cppflags, "-E")
if linemarkers == false then
table.insert(cppflags, "-EP")
end
- table.insert(cppflags, "-Fi" .. cppfile)
table.insert(cppflags, sourcefile)
return try{ function()
- local outdata, errdata = vstool.iorunv(program, winos.cmdargv(cppflags), opt)
- return {outdata = outdata, errdata = errdata,
+ local outdata, errdata = os.iorunv(program, winos.cmdargv(cppflags), opt)
+ io.writefile(cppfile, outdata or "")
+ -- includes information will be output to stderr instead of stdout now
+ return {outdata = errdata, errdata = errdata,
sourcefile = sourcefile, objectfile = objectfile, cppfile = cppfile, cppflags = flags,
pdbfile = pdbfile}
end}
@@ -637,3 +638,4 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
end
end
end
+