summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/gcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-11-02 00:46:11 +0800
committerruki <[email protected]>2022-11-02 00:46:11 +0800
commita9a1788edab12cd63931278ce8d0e4ed02f5046d (patch)
tree2a88cc87646c01048759ad5c0fd33b93ed1aee04 /xmake/modules/core/tools/gcc.lua
parente639c493025b5d6c5cbdbe588759d34ff8d772b4 (diff)
paser gcc deps with modules
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
-rw-r--r--xmake/modules/core/tools/gcc.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 897103404..3a916ac9a 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -604,6 +604,13 @@ function _compargv_pch(self, pcheaderfile, pcoutputfile, flags)
return self:program(), table.join("-c", pchflags, "-o", pcoutputfile, pcheaderfile)
end
+-- get modules cache directory
+function _modules_cachedir(target)
+ if target and target.autogendir then -- we need ignore option instance
+ return path.join(target:autogendir(), "rules", "modules", "cache")
+ end
+end
+
-- make the compile arguments list
function compargv(self, sourcefile, objectfile, flags)
-- precompiled header?
@@ -621,6 +628,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
os.mkdir(path.directory(objectfile))
-- compile it
+ opt = opt or {}
local depfile = dependinfo and os.tmpfile() or nil
try
{
@@ -706,6 +714,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
if depfile and os.isfile(depfile) then
if dependinfo then
dependinfo.depfiles_gcc = io.readfile(depfile, {continuation = "\\"})
+ dependinfo.modules_cachedir = _modules_cachedir(opt.target)
end
-- remove the temporary dependent file