summaryrefslogtreecommitdiff
path: root/xmake/core/language/language.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-27 19:27:12 +0800
committerruki <[email protected]>2017-07-27 19:27:12 +0800
commit6f2c9ecd0d7ea9f2fbfab79b6960eb1274ca816a (patch)
tree322b4e7ba82e82ce8a6d0c4b56d044bbcde2d010 /xmake/core/language/language.lua
parent84defbee206dd2d810070bfae7b7e269a3445896 (diff)
impl compile pch for gcc
Diffstat (limited to 'xmake/core/language/language.lua')
-rw-r--r--xmake/core/language/language.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/core/language/language.lua b/xmake/core/language/language.lua
index 8bf9395ae..4aa10c5e4 100644
--- a/xmake/core/language/language.lua
+++ b/xmake/core/language/language.lua
@@ -561,6 +561,19 @@ function language.sourcekind_of(sourcefile)
return sourcekind
end
+-- get extension of the source kind
+function language.extension_of(sourcekind)
+
+ -- get extension
+ local extension = table.wrap(language.sourcekinds()[sourcekind])[1]
+ if not extension then
+ return nil, string.format("%s is unknown source kind", sourcekind)
+ end
+
+ -- ok
+ return extension
+end
+
-- get linker infos(kind and flag) of the target kind and the source kinds
function language.linkerinfos_of(targetkind, sourcekinds)