summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/project.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/project.lua
parenta2c560f7c2f1f4501516d39225d5afdd06dc9c55 (diff)
load xmake.xconf before loading project
Diffstat (limited to 'xmake/scripts/base/project.lua')
-rw-r--r--xmake/scripts/base/project.lua38
1 files changed, 38 insertions, 0 deletions
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"