summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/config.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-05 11:41:23 +0800
committerruki <[email protected]>2015-06-05 11:41:23 +0800
commit9c4c565ef5cba3c668b338ed0066cff0d58e8caa (patch)
tree1976b7ca1c84e29d4a812a67f46834cd1fa98b57 /xmake/scripts/base/config.lua
parent4fd209354ecf8a6f90b5a19a18e2268e3c9d649f (diff)
clearup config and global
Diffstat (limited to 'xmake/scripts/base/config.lua')
-rw-r--r--xmake/scripts/base/config.lua29
1 files changed, 25 insertions, 4 deletions
diff --git a/xmake/scripts/base/config.lua b/xmake/scripts/base/config.lua
index cb9f269c2..a4cc7f3f2 100644
--- a/xmake/scripts/base/config.lua
+++ b/xmake/scripts/base/config.lua
@@ -141,10 +141,6 @@ function config._make()
config._CURRENT = config._CURRENT or {}
local current = config._CURRENT
- -- init the current target
- current.target = options.target or options._DEFAULTS.target
- assert(current.target)
-
-- get configs from the global configure first
if global._CURRENT then
for k, v in pairs(global._CURRENT) do
@@ -445,6 +441,31 @@ function config.loadxconf()
config._make()
end
+-- clear up and remove all auto values
+function config.clearup()
+
+ -- clear up the current configure
+ local current = config._CURRENT
+ if current then
+ for k, v in pairs(current) do
+ if v and type(v) and v == "auto" then
+ current[k] = nil
+ end
+ end
+ end
+
+ -- clear up the current target configure
+ local target = config._target()
+ if target then
+ for k, v in pairs(target) do
+ if v and type(v) and v == "auto" then
+ target[k] = nil
+ end
+ end
+ end
+
+end
+
-- dump the current configure
function config.dump()