diff options
| author | ruki <[email protected]> | 2025-01-24 22:49:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-01-24 22:49:28 +0800 |
| commit | 8a4e42c388159e2046a22f32c6551acb961ac586 (patch) | |
| tree | 8df184198deb113eabf8c6d3dd1dd515fa8107c9 /xmake/modules/core/tools/cl6x.lua | |
| parent | 1f59ab2428339916eafc2bdc1350641cc1c4f6d3 (diff) | |
parse depsfile
Diffstat (limited to 'xmake/modules/core/tools/cl6x.lua')
| -rw-r--r-- | xmake/modules/core/tools/cl6x.lua | 15 |
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 } } |
