From ab36dca23f1cd80720e9d0eb2c3ce72d5895ba3e Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 15 May 2015 08:39:20 +0800 Subject: load xmake.xconf before loading project --- xmake/scripts/base/main.lua | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'xmake/scripts/base/main.lua') 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") -- cgit v1.3.1