summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-14 13:35:29 +0800
committerruki <[email protected]>2017-07-14 13:35:29 +0800
commit70716c5ed3037f2aaf79c6c19b175c0018e7309f (patch)
tree6fba1dec356b7508f21c9c3a0519e6f424f28f41 /xmake/modules/detect/tools
parentf39f4a27d43a1f63d56ae3c9f7fc34b5158e299a (diff)
add language kinds
Diffstat (limited to 'xmake/modules/detect/tools')
-rw-r--r--xmake/modules/detect/tools/gcc/features.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/xmake/modules/detect/tools/gcc/features.lua b/xmake/modules/detect/tools/gcc/features.lua
index da65e87a2..09c9e857a 100644
--- a/xmake/modules/detect/tools/gcc/features.lua
+++ b/xmake/modules/detect/tools/gcc/features.lua
@@ -59,15 +59,16 @@ function _set_feature(feature, condition)
-- init features
_g.features = _g.features or {}
- -- get feature kind
- local kind = feature:match("^(%w-)_")
- assert(kind, "unknown kind for the feature: %s", feature)
+ -- get language kind
+ local langkind = feature:match("^(%w-)_")
+ assert(langkind, "unknown language kind for the feature: %s", feature)
- -- init maps for c, objc
- local kinds = {c = "cc", m = "mm"}
+ -- get source kind from the language kind
+ local sourcekind = language.langkinds()[langkind]
+ assert(sourcekind, "unknown language kind: " .. langkind)
-- get extension
- local extension = table.wrap(language.sourcekinds()[kinds[kind] or kind])[1]
+ local extension = table.wrap(language.sourcekinds()[sourcekind])[1]
assert(extension, "not supported kind for the feature: %s", feature)
-- make snippet