summaryrefslogtreecommitdiff
path: root/xmake/core/project/target.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-06 22:38:17 +0800
committerruki <[email protected]>2019-09-06 09:49:43 +0800
commite5152e174154dde4f9fdd3f49047f36c0966d7ea (patch)
treeabd39a906a05aa856dbb18b4813d9181ae8a1fdd /xmake/core/project/target.lua
parentcfb90668f507c9b93fa3e53f78f8f46cdb136413 (diff)
impl clang modules
Diffstat (limited to 'xmake/core/project/target.lua')
-rw-r--r--xmake/core/project/target.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 911d8ddbf..5584ed569 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -48,6 +48,7 @@ function _instance.new(name, info, project)
instance._NAME = name
instance._INFO = info
instance._PROJECT = project
+ instance._CACHEID = 1
return instance
end
@@ -239,6 +240,11 @@ function _instance:_visibility(opt)
return visibility
end
+-- invalidate the previous cache key
+function _instance:_invalidate()
+ self._CACHEID = self._CACHEID + 1
+end
+
-- get the target info
--
-- e.g.
@@ -298,16 +304,19 @@ end
-- set the value to the target info
function _instance:set(name, ...)
self._INFO:apival_set(name, ...)
+ self:_invalidate()
end
-- add the value to the target info
function _instance:add(name, ...)
self._INFO:apival_add(name, ...)
+ self:_invalidate()
end
-- remove the value to the target info
function _instance:del(name, ...)
self._INFO:apival_del(name, ...)
+ self:_invalidate()
end
-- get the extra configuration
@@ -387,6 +396,11 @@ function _instance:name()
return self._NAME
end
+-- get the cache key
+function _instance:cachekey()
+ return string.format("%s_%d", tostring(self), self._CACHEID)
+end
+
-- get the target version
function _instance:version()