diff options
| author | ruki <[email protected]> | 2015-06-11 11:59:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-11 11:59:45 +0800 |
| commit | 2680c6575a238d0a199f2a31fcf47cd6d0687b62 (patch) | |
| tree | 87bfdd3873bd2d560f3ce1192ba034974535b024 /xmake/scripts/base/main.lua | |
| parent | b5815f7c047221ea4a85333f7a8b6be5a2a4c737 (diff) | |
check includes, links and interfaces
Diffstat (limited to 'xmake/scripts/base/main.lua')
| -rw-r--r-- | xmake/scripts/base/main.lua | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua index 2f038c8cd..888c4d41a 100644 --- a/xmake/scripts/base/main.lua +++ b/xmake/scripts/base/main.lua @@ -87,7 +87,7 @@ local menu = } -- prepare global -function main._prepare_global() +function main._init_global() -- the options local options = xmake._OPTIONS @@ -110,8 +110,8 @@ function main._prepare_global() return true end --- prepare project -function main._prepare_project() +-- init project +function main._init_project() -- the options local options = xmake._OPTIONS @@ -132,6 +132,21 @@ function main._prepare_project() -- probe the current platform platform.probe(false) + end + + -- merge the default options + for k, v in pairs(options._DEFAULTS) do + if nil == options[k] then options[k] = v end + end + + -- make the current platform configure + if not platform.make() then + return string.format("make platform configure: %s failed!", config.get("plat")) + end + + -- xmake config or marked as "reconfig"? + if options._ACTION == "config" or config._RECONFIG then + -- probe the current project project.probe() @@ -140,11 +155,6 @@ function main._prepare_project() end - -- merge the default options - for k, v in pairs(options._DEFAULTS) do - if nil == options[k] then options[k] = v end - end - -- load the project return project.load() end @@ -200,35 +210,21 @@ function main._done_option() return action.done("lua") end - -- prepare global - main._prepare_global() + -- init global + main._init_global() -- done global? if options._ACTION == "global" then return action.done("global") end - -- prepare project - local errors = main._prepare_project() + -- init project + local errors = main._init_project() if errors then -- error utils.error(errors) return false end - - -- make the current platform configure - if not platform.make() then - -- error - utils.error("make platform configure: %s failed!", config.get("plat")) - return false - end - - -- enter the project directory - if not os.cd(xmake._PROJECT_DIR) then - -- error - utils.error("not found project: %s!", xmake._PROJECT_DIR) - return false - end -- reconfig it first if marked as "reconfig" if config._RECONFIG and not action.done("config") then @@ -262,6 +258,12 @@ function main._init() xmake._PROJECT_FILE = projectfile assert(projectfile) + -- enter the project directory + if not os.cd(xmake._PROJECT_DIR) then + -- error + utils.error("not found project: %s!", xmake._PROJECT_DIR) + return false + end end -- the main function |
