summaryrefslogtreecommitdiff
path: root/xmake/core/project/config.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-04-05 20:59:09 +0800
committerruki <[email protected]>2016-04-05 20:59:09 +0800
commit17cef33022bf3308ebd03546ab65464f9390e69c (patch)
treeadf735a77bfbfa87a1c08d121f1348062e84dfb2 /xmake/core/project/config.lua
parent444f3f3f9e9dabf46da999d6d8d6f200c672a866 (diff)
impl auto rebuild for config
Diffstat (limited to 'xmake/core/project/config.lua')
-rw-r--r--xmake/core/project/config.lua22
1 files changed, 17 insertions, 5 deletions
diff --git a/xmake/core/project/config.lua b/xmake/core/project/config.lua
index 761855011..b43584f83 100644
--- a/xmake/core/project/config.lua
+++ b/xmake/core/project/config.lua
@@ -151,16 +151,28 @@ function config.save(targetname)
results.__version = xmake._VERSION
-- update options for the given target
- local target = results
+ local target = nil
if targetname ~= "all" then
- -- get target
- target = results._TARGETS or {}
- results._TARGETS = target
+ -- the targets
+ local targets = results._TARGETS or {}
+ results._TARGETS = targets
+
+ -- clear target and get it
+ targets[targetname] = {}
+ target = targets[targetname]
+ else
+
+ -- the targets
+ local targets = results._TARGETS
+
+ -- clear the root target and get it
+ results = {_TARGETS = targets}
+ target = results
end
- -- update it
+ -- update target
for name, value in pairs(config.options()) do
target[name] = value
end