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/project.lua | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'xmake/scripts/base/project.lua') diff --git a/xmake/scripts/base/project.lua b/xmake/scripts/base/project.lua index 5ed4229f0..f2cf1a9f0 100644 --- a/xmake/scripts/base/project.lua +++ b/xmake/scripts/base/project.lua @@ -155,6 +155,44 @@ function _register(names) end end +-- load xproj +function loadxproj(file) + + -- check + assert(file) + + -- load and execute the xmake.xproj + local script = preprocessor.load_xproj(file) + if script then + + -- init the project envirnoment + setfenv(script, _PROJECT) + + -- execute it + local ok, err = pcall(script) + if not ok then + -- error + return false, err + end + else + -- error + return false, string.format("load %s failed!", file) + end + + -- ok + return true +end + +-- dump all configures +function dump() + + -- dump + if xmake._OPTIONS.verbose then + utils.dump(xmake._PROJECT._CONFIGS, "", "_PARENT") + end + +end + -- register all configures _register { "kind" , "deps" -- cgit v1.3.1