summaryrefslogtreecommitdiff
path: root/xmake/core/project/project.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-03-16 11:01:10 +0800
committerruki <[email protected]>2016-03-16 11:01:10 +0800
commit713413a6f962704fdb5078a38b32c8637eca3d7a (patch)
tree68fde05da6780dd76a3150a66d331215b0bc058e /xmake/core/project/project.lua
parent566d33d6be83884239cce7df0655e60ec00bd836 (diff)
save configure
Diffstat (limited to 'xmake/core/project/project.lua')
-rw-r--r--xmake/core/project/project.lua33
1 files changed, 14 insertions, 19 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index d8b19081b..c8f0a0fa2 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -862,6 +862,20 @@ function project._make_options(options)
end
+-- get the given target
+function project.target(targetname)
+
+ -- check
+ assert(targetname and targetname ~= "all")
+
+ -- the targets
+ local targets = project.targets()
+ assert(targets)
+
+ -- get it
+ return targets[targetname]
+end
+
-- get the current configure for targets
function project.targets()
@@ -965,25 +979,6 @@ function project.makeconf(target_name)
return true
end
--- check target
-function project.checktarget(target_name)
-
- -- the targets
- local targets = project.targets()
-
- -- invalid target?
- if target_name and target_name ~= "all" and targets and not targets[target_name] then
- utils.error("invalid target: %s!", target_name)
- return false
- elseif not target_name then
- utils.error("no target!")
- return false
- end
-
- -- ok
- return true
-end
-
-- get the project menu
function project.menu()