summaryrefslogtreecommitdiff
path: root/xmake/actions/config/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-05-22 23:59:41 +0800
committerruki <[email protected]>2021-05-22 23:59:41 +0800
commitbd080f2c7943471935bf5d67b04484bed5ace455 (patch)
treeaae79096718dd38b1767a61fc8ecd4e0855afa98 /xmake/actions/config/main.lua
parentfdfa79d46fbaf0f674e343f4939859cbe9bbe40f (diff)
improve config cache
Diffstat (limited to 'xmake/actions/config/main.lua')
-rw-r--r--xmake/actions/config/main.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua
index 54bcc6a1f..3393e1603 100644
--- a/xmake/actions/config/main.lua
+++ b/xmake/actions/config/main.lua
@@ -65,17 +65,12 @@ function _need_check(changed)
changed = option.get("clean")
end
- -- get the current mtimes
+ -- check for all project files
local mtimes = project.mtimes()
-
- -- get the previous mtimes
if not changed then
local mtimes_prev = localcache.get("config", "mtimes")
if mtimes_prev then
-
- -- check for all project files
for file, mtime in pairs(mtimes) do
-
-- modified? reconfig and rebuild it
local mtime_prev = mtimes_prev[file]
if not mtime_prev or mtime > mtime_prev then
@@ -86,6 +81,11 @@ function _need_check(changed)
end
end
+ -- unfinished config/recheck
+ if not changed and localcache.get("config", "recheck") then
+ changed = true
+ 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
@@ -96,8 +96,6 @@ function _need_check(changed)
-- update mtimes
localcache.set("config", "mtimes", mtimes)
-
- -- changed?
return changed
end
@@ -314,6 +312,7 @@ force to build in current directory via run `xmake -P .`]], os.projectdir())
localcache.clear("option")
localcache.clear("package")
localcache.clear("toolchain")
+ localcache.set("config", "recheck", true)
localcache.save()
-- check platform
@@ -369,6 +368,7 @@ force to build in current directory via run `xmake -P .`]], os.projectdir())
end
-- save options and config cache
+ localcache.set("config", "recheck", false)
config.save()
localcache.set("config", "options", options)
localcache.save("config")