summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-05-15 08:39:20 +0800
committerruki <[email protected]>2015-05-15 08:39:20 +0800
commitab36dca23f1cd80720e9d0eb2c3ce72d5895ba3e (patch)
tree719784494abe3ae5a3c96f779658893fe09061c0 /xmake/scripts/base/main.lua
parenta2c560f7c2f1f4501516d39225d5afdd06dc9c55 (diff)
load xmake.xconf before loading project
Diffstat (limited to 'xmake/scripts/base/main.lua')
-rw-r--r--xmake/scripts/base/main.lua26
1 files changed, 7 insertions, 19 deletions
diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua
index 04d3d9e52..3b9f3d57a 100644
--- a/xmake/scripts/base/main.lua
+++ b/xmake/scripts/base/main.lua
@@ -27,6 +27,7 @@ local main = main or {}
local path = require("base/path")
local utils = require("base/utils")
local option = require("base/option")
+local config = require("base/config")
local project = require("base/project")
local preprocessor = require("base/preprocessor")
local action = require("action/action")
@@ -276,24 +277,11 @@ function main._done_option()
end
assert(options.file)
- -- load and execute the xmake.xproj
- local errors = nil
- local script = preprocessor.load_xproj(options.file)
- if script then
+ -- load xmake.xconf file
+ config.loadxconf()
- -- init the project envirnoment
- setfenv(script, project)
-
- -- execute it
- local ok, err = pcall(script)
- if not ok then
- -- error
- errors = err
- end
- else
- -- error
- errors = string.format("load %s failed!", options.file)
- end
+ -- load xmake.xproj file
+ local _, errors = project.loadxproj(options.file)
-- done help
if options.help then
@@ -328,8 +316,8 @@ function main._done_option()
-- save project
xmake._PROJECT = project
- -- dump project configs
--- utils.dump(xmake._PROJECT._CONFIGS, "", "_PARENT")
+ -- dump project
+ project.dump()
-- done action
return action.done(options._ACTION or "build")