From 33ad09c9a126cb83ba45fb6f1f2c2898cfbb2dbb Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 10 Jun 2015 15:13:17 +0800 Subject: save object to configure --- xmake/scripts/base/project.lua | 44 ++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) (limited to 'xmake/scripts/base/project.lua') diff --git a/xmake/scripts/base/project.lua b/xmake/scripts/base/project.lua index 4fd325f02..a42028e29 100644 --- a/xmake/scripts/base/project.lua +++ b/xmake/scripts/base/project.lua @@ -321,8 +321,8 @@ function project._makeconf_for_target_and_deps(target_name) return true end --- make the project configure -function project._make(configs) +-- make targets from the project file +function project._make_targets(configs) -- check assert(configs) @@ -373,6 +373,18 @@ function project._make(configs) end end +-- make options from the project file +function project._make_options(configs) + + -- check + assert(configs) + + -- init + project._OPTIONS = project._OPTIONS or {} + local options = project._OPTIONS + +end + -- only load options from the the project file function project._load_options(file) @@ -534,18 +546,30 @@ function project.targets() return project._TARGETS end --- load the project file -function project.load(file) +-- probe the project +function project.probe() + + -- load the options from the the project file + local configs, errors = project._load_options(xmake._PROJECT_FILE) + if not configs then + return errors + end + + -- make the options from the the project file + project._make_options(configs) +end + +-- load the project +function project.load() - -- load the targets from the the project configure - local configs, errors = project._load_targets(file) + -- load the targets from the the project file + local configs, errors = project._load_targets(xmake._PROJECT_FILE) if not configs then - utils.error(errors) - return + return errors end - -- load and make targets from the the project configure - project._make(configs) + -- make the targets from the the project file + project._make_targets(configs) end -- dump the current configure -- cgit v1.3.1