summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/main.lua
diff options
context:
space:
mode:
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")