summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools/gcc/features.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-10 21:34:02 +0800
committerruki <[email protected]>2017-07-10 21:34:02 +0800
commit03420ca44581f299a48935ca60af4824575cd9c1 (patch)
treeb4644e07c92e62b973d15f3f0d3e0ee41f95446e /xmake/modules/detect/tools/gcc/features.lua
parentdef23a930fc3780e54b2a8a6fc60854d2e193000 (diff)
add has_features and features for compiler
Diffstat (limited to 'xmake/modules/detect/tools/gcc/features.lua')
-rw-r--r--xmake/modules/detect/tools/gcc/features.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/xmake/modules/detect/tools/gcc/features.lua b/xmake/modules/detect/tools/gcc/features.lua
index 5047cb36c..da65e87a2 100644
--- a/xmake/modules/detect/tools/gcc/features.lua
+++ b/xmake/modules/detect/tools/gcc/features.lua
@@ -25,6 +25,7 @@
-- imports
import("cfeatures")
import("cxxfeatures")
+import("core.language.language")
-- get macro defines
function _get_macro_defines(snippets, extension, opt)
@@ -62,11 +63,11 @@ function _set_feature(feature, condition)
local kind = feature:match("^(%w-)_")
assert(kind, "unknown kind for the feature: %s", feature)
- -- init language extensions
- _g.extensions = _g.extensions or {c = ".c", cxx = ".cpp", objc = ".m", objcxx = ".mm"}
+ -- init maps for c, objc
+ local kinds = {c = "cc", m = "mm"}
-- get extension
- local extension = _g.extensions[kind]
+ local extension = table.wrap(language.sourcekinds()[kinds[kind] or kind])[1]
assert(extension, "not supported kind for the feature: %s", feature)
-- make snippet