summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools/gcc/features.lua
diff options
context:
space:
mode:
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