summaryrefslogtreecommitdiff
path: root/xmake/core/project/target.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/project/target.lua')
-rw-r--r--xmake/core/project/target.lua28
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 ...