summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-05-13 11:49:22 +0800
committerruki <[email protected]>2015-05-13 11:49:22 +0800
commit1f45e3bf9b41a413804305fc23810639b977a9f1 (patch)
tree1eaee4fe5f942fa8ee5c9dd2ec1e6a17dbe912f4 /xmake/scripts/base/main.lua
parentba92342286d9fabb29c97acac4c5deed0906a25b (diff)
add project configure
Diffstat (limited to 'xmake/scripts/base/main.lua')
-rw-r--r--xmake/scripts/base/main.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua
index 77af72118..d52648fb3 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 project = require("base/project")
local action = require("action/action")
-- init the option menu
@@ -274,10 +275,14 @@ function main._done_option()
end
assert(options.file)
- -- load and execute the xmake.lua script of the given project
+ -- load and execute the project script
local errors = nil
local script = loadfile(options.file)
if script then
+
+ -- init the project envirnoment
+ setfenv(script, project)
+
-- execute it
local ok, err = pcall(script)
if not ok then
@@ -319,6 +324,9 @@ function main._done_option()
return false
end
+ -- save project
+ xmake._PROJECT = project
+
-- done action
return action.done(options._ACTION or "build")
end