summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-20 21:02:36 +0800
committerruki <[email protected]>2020-06-20 21:02:36 +0800
commit9952e551b93d71d5428dc99633fb770d8e0636f4 (patch)
treedbd8651bd3a9b74418aa37b0ae0608f7aa0e961c
parentd3eb3f508142bdd29a243b469116a665cf929f3d (diff)
improve config cache
-rw-r--r--xmake/actions/config/main.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua
index f6b9e4b5b..627f70853 100644
--- a/xmake/actions/config/main.lua
+++ b/xmake/actions/config/main.lua
@@ -85,6 +85,14 @@ function _need_check(changed)
end
end
+ -- xmake has been updated? force to check config again
+ -- we need clean the dirty config cache of the old version
+ if not changed then
+ if os.mtime(path.join(os.programdir(), "core", "main.lua")) > os.mtime(config.filepath()) then
+ changed = true
+ end
+ end
+
-- update mtimes
configcache:set("mtimes", mtimes)