diff options
| author | ruki <[email protected]> | 2016-07-10 10:18:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-07-10 10:18:05 +0800 |
| commit | fd39adb3d959e605370098a72ec7e92b462fce62 (patch) | |
| tree | 392b866ab32e33cae167c95daa7bff7cfbb9767c /xmake/core/project/target.lua | |
| parent | 4d2231a5136ddf5dca5398feaccc2d82bb56e1e0 (diff) | |
check include dependence
Diffstat (limited to 'xmake/core/project/target.lua')
| -rw-r--r-- | xmake/core/project/target.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 5e3669c69..27d4e926b 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -358,6 +358,34 @@ function target:headerfiles(outputdir) return srcheaders, dstheaders end +-- get the dependent include files +function target:incdepfiles() + + -- the previous object files + local objectfiles_prev = self._OBJECTFILES + + -- the object files + local objectfiles = self:objectfiles() + + -- cached? return it directly + local modified = objectfiles_prev ~= objectfiles + if self._INCDEPFILES and not modified then + return self._INCDEPFILES + end + + -- make include files + local incdepfiles = {} + for _, objectfile in ipairs(objectfiles) do + table.insert(incdepfiles, path.join(path.directory(objectfile), path.basename(objectfile) .. ".d")) + end + + -- cache it + self._INCDEPFILES = incdepfiles + + -- ok + return incdepfiles +end + -- get the kinds of sourcefiles -- -- .e.g cc cxx mm mxx as ... |
