summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/project.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-12-28 08:52:20 +0800
committerruki <[email protected]>2015-12-28 08:52:20 +0800
commite0dab0305d1967b57b12d2deb94e4253bf7cde06 (patch)
tree4210f509a4684bd552333fd283a54d29c528b648 /xmake/scripts/base/project.lua
parentf68d912cc271ec162b07ca68538d7f3689415b54 (diff)
add kind configure and remove set_targetname api
Diffstat (limited to 'xmake/scripts/base/project.lua')
-rw-r--r--xmake/scripts/base/project.lua18
1 files changed, 17 insertions, 1 deletions
diff --git a/xmake/scripts/base/project.lua b/xmake/scripts/base/project.lua
index 02958c106..531f315b2 100644
--- a/xmake/scripts/base/project.lua
+++ b/xmake/scripts/base/project.lua
@@ -102,6 +102,21 @@ function project._api_archs(env, ...)
end
end
+-- the current kind is belong to the given kinds?
+function project._api_kinds(env, ...)
+
+ -- get the current kind
+ local kind = config.get("kind")
+ if not kind then return false end
+
+ -- exists this kind?
+ for _, k in ipairs(table.join(...)) do
+ if k and type(k) == "string" and k == kind then
+ return true
+ end
+ end
+end
+
-- enable options?
function project._api_options(env, ...)
@@ -1060,6 +1075,7 @@ function project._load_options(file)
-- register interfaces for the condition
newenv.os = function (...) return project._api_os(newenv, ...) end
newenv.modes = function (...) return project._api_modes(newenv, ...) end
+ newenv.kinds = function (...) return project._api_kinds(newenv, ...) end
newenv.plats = function (...) return project._api_plats(newenv, ...) end
newenv.archs = function (...) return project._api_archs(newenv, ...) end
@@ -1169,6 +1185,7 @@ function project._load_targets(file)
-- register interfaces for the condition
newenv.os = function (...) return project._api_os(newenv, ...) end
newenv.modes = function (...) return project._api_modes(newenv, ...) end
+ newenv.kinds = function (...) return project._api_kinds(newenv, ...) end
newenv.plats = function (...) return project._api_plats(newenv, ...) end
newenv.archs = function (...) return project._api_archs(newenv, ...) end
newenv.options = function (...) return project._api_options(newenv, ...) end
@@ -1193,7 +1210,6 @@ function project._load_targets(file)
-- register interfaces for setting values
local interfaces = { "kind"
- , "targetname"
, "config_h_prefix"
, "version"
, "strip"