summaryrefslogtreecommitdiff
path: root/xmake/core/project/global.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/project/global.lua')
-rw-r--r--xmake/core/project/global.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/xmake/core/project/global.lua b/xmake/core/project/global.lua
index 6b600d51b..95b11984d 100644
--- a/xmake/core/project/global.lua
+++ b/xmake/core/project/global.lua
@@ -20,7 +20,7 @@
-- @file global.lua
--
--- define module: global
+-- define module
local global = global or {}
-- load modules
@@ -30,13 +30,20 @@ local path = require("base/path")
local utils = require("base/utils")
local option = require("base/option")
+-- get the configure file
+function global._file()
+
+ -- get it
+ return path.join(global.directory(), "/xmake.conf")
+end
+
-- make configure
function global._make(configs)
-- check
assert(configs)
- -- make current global configure
+ -- make current configure
local current = {}
for k, v in pairs(configs) do
if type(k) == "string" and not k:find("^_%u+") then
@@ -48,13 +55,6 @@ function global._make(configs)
return current
end
--- get the configure file
-function global._file()
-
- -- get it
- return path.join(global.directory(), "/xmake.conf")
-end
-
-- get the given configure from the current
function global.get(name)
@@ -100,9 +100,12 @@ function global.clean()
if os.isfile(global._file()) then
local ok, errors = os.rm(global._file())
if not ok then
- os.raise(errors)
+ return false, errors
end
end
+
+ -- ok
+ return true
end
-- get all options
@@ -144,9 +147,6 @@ function global.load()
-- make the current configs
global._CURRENT = global._make(global._CONFIGS)
- -- ok
- return true
-
end
-- save the global configure
@@ -189,5 +189,5 @@ function global.dump()
end
--- return module: global
+-- return module
return global