diff options
Diffstat (limited to 'xmake/core/project/cache.lua')
| -rw-r--r-- | xmake/core/project/cache.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xmake/core/project/cache.lua b/xmake/core/project/cache.lua index 1b3b63c7f..d96f12e00 100644 --- a/xmake/core/project/cache.lua +++ b/xmake/core/project/cache.lua @@ -56,6 +56,13 @@ function cache._instance(scopename) -- init instance local instance = table.inherit(cache) + -- memory cache? + if scopename:startswith("memory.") then + instance._CACHEDATA = instance._CACHEDATA or {__version = xmake._VERSION_SHORT} + instances[scopename] = instance + return instance + end + -- check scopename if not scopename:find("local%.") and not scopename:find("global%.") then os.raise("invalid cache scope: %s", scopename) @@ -110,6 +117,11 @@ function cache:flush() -- flush the version self._CACHEDATA.__version = xmake._VERSION_SHORT + -- memory cache? ignore it directly + if not self._CACHEPATH then + return true + end + -- save to file return io.save(self._CACHEPATH, self._CACHEDATA) end |
