summaryrefslogtreecommitdiff
path: root/xmake/actions/config/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-04-01 21:04:10 +0800
committerruki <[email protected]>2016-04-01 21:04:10 +0800
commit70e2500e9a37a57622c7b4875171e6f07fd523ae (patch)
tree17bb5785a597d58b42d1054c7fc7b94f7a94cb87 /xmake/actions/config/main.lua
parent9a71fdfde331506e9c5eb2da93f1f95641e66de5 (diff)
clean cache for config
Diffstat (limited to 'xmake/actions/config/main.lua')
-rwxr-xr-xxmake/actions/config/main.lua16
1 files changed, 15 insertions, 1 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua
index 9027573b2..468afbca4 100755
--- a/xmake/actions/config/main.lua
+++ b/xmake/actions/config/main.lua
@@ -34,6 +34,20 @@ function _option_filter(name)
return name and name ~= "target" and name ~= "file" and name ~= "project" and name ~= "verbose" and name ~= "clean"
end
+-- need clean the cached configure?
+function _need_clean_cache()
+
+ -- the host has been changed? clean it
+ if config.host() ~= vformat("$(host)") then
+ return true
+ end
+
+ -- the plat has been changed? clean it
+ if option.get("plat") and config.plat() and option.get("plat") ~= config.plat() then
+ return true
+ end
+end
+
-- main
function main()
@@ -52,7 +66,7 @@ function main()
config.load(targetname)
-- clean the cached configure?
- if option.get("clean") then
+ if option.get("clean") or _need_clean_cache() then
-- clean it
config.clean()