summaryrefslogtreecommitdiff
path: root/xmake/scripts/action/_global.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-05-26 10:19:43 +0800
committerruki <[email protected]>2015-05-26 10:19:43 +0800
commitf4562609df7ac3f395e5178e76fcefa2c1ffa980 (patch)
tree526caad47b590de1be57996ee19b28d4e34d082a /xmake/scripts/action/_global.lua
parent49ae120e090b2d4dd15e486ade2dfc2ea1ded440 (diff)
probe configure for macosx
Diffstat (limited to 'xmake/scripts/action/_global.lua')
-rw-r--r--xmake/scripts/action/_global.lua33
1 files changed, 26 insertions, 7 deletions
diff --git a/xmake/scripts/action/_global.lua b/xmake/scripts/action/_global.lua
index daf7774e4..d911a3ba2 100644
--- a/xmake/scripts/action/_global.lua
+++ b/xmake/scripts/action/_global.lua
@@ -17,20 +17,39 @@
-- Copyright (C) 2009 - 2015, ruki All rights reserved.
--
-- @author ruki
--- @file _config.lua
+-- @file _global.lua
--
--- define module: _config
-local _config = _config or {}
+-- define module: _global
+local _global = _global or {}
-- load modules
local utils = require("base/utils")
local global = require("base/global")
+local platform = require("platform/platform")
-- done the given config
-function _config.done()
+function _global.done()
- -- save globals
+ -- wrap the global configure for more convenient to get and set values
+ local global_wrapped = {}
+ setmetatable(global_wrapped,
+ {
+ __index = function(tbl, key)
+ return global.get(key)
+ end,
+ __newindex = function(tbl, key, val)
+ global.set(key, val)
+ end
+ })
+
+ -- probe the global configure
+ platform.probe(global_wrapped, true)
+
+ -- dump global
+ global.dump()
+
+ -- save the global configure
if not global.savexconf() then
-- error
utils.error("save configure failed!")
@@ -42,5 +61,5 @@ function _config.done()
return true
end
--- return module: _config
-return _config
+-- return module: _global
+return _global