summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/gcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-08-01 11:52:55 +0800
committerruki <[email protected]>2017-08-01 11:52:55 +0800
commitc87c400fcbb581c1590694bf6ee05d73d5d3e984 (patch)
tree613f69068bd9015aecc891b5b67df7992b7e5e54 /xmake/modules/core/tools/gcc.lua
parentfa9702bfcf4ba7ed2b599727913444cc3498bfda (diff)
improve dep compile and link
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
-rw-r--r--xmake/modules/core/tools/gcc.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 20192cf85..7fbe4aa3e 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -297,8 +297,8 @@ function _include_deps(self, sourcefile, flags)
-- translate it
results = {}
- local incdeps = io.readfile(tmpfile)
- for includefile in string.gmatch(incdeps, "%s+([%w/%.%-%+_%$%.]+)") do
+ local deps = io.readfile(tmpfile)
+ for includefile in string.gmatch(deps, "%s+([%w/%.%-%+_%$%.]+)") do
-- save it if belong to the project
if not path.is_absolute(includefile) then
@@ -381,7 +381,7 @@ function _compargv1(self, sourcefile, objectfile, flags)
end
-- complie the source file
-function _compile1(self, sourcefile, objectfile, incdepfile, flags)
+function _compile1(self, sourcefile, objectfile, depinfo, flags)
-- ensure the object directory
os.mkdir(path.directory(objectfile))
@@ -416,9 +416,9 @@ function _compile1(self, sourcefile, objectfile, incdepfile, flags)
}
}
- -- generate includes file
- if incdepfile and self:kind() ~= "as" then
- io.save(incdepfile, _include_deps(self, sourcefile, flags))
+ -- generate the dependent includes
+ if depinfo and self:kind() ~= "as" then
+ depinfo.includes = _include_deps(self, sourcefile, flags)
end
end
@@ -433,12 +433,12 @@ function compargv(self, sourcefiles, objectfile, flags)
end
-- complie the source file
-function compile(self, sourcefiles, objectfile, incdepfile, flags)
+function compile(self, sourcefiles, objectfile, depinfo, flags)
-- only support single source file now
assert(type(sourcefiles) ~= "table", "'object:sources' not support!")
-- for only single source file
- _compile1(self, sourcefiles, objectfile, incdepfile, flags)
+ _compile1(self, sourcefiles, objectfile, depinfo, flags)
end