summaryrefslogtreecommitdiff
path: root/xmake/core/tool/compiler.lua
diff options
context:
space:
mode:
authorenorof <[email protected]>2016-09-16 20:36:50 +0800
committerenorof <[email protected]>2016-09-16 20:36:50 +0800
commite15e08d70cadfe3d6d3b42756cb92ff4ac77ba61 (patch)
tree87049136b99c4db16c4108baeb3ad4eb7feec4d6 /xmake/core/tool/compiler.lua
parent252f501054ab2058320319a1cb9f749858b6776c (diff)
add filters for vs201x project.
Diffstat (limited to 'xmake/core/tool/compiler.lua')
-rw-r--r--xmake/core/tool/compiler.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua
index 81c6c5da8..9ac87cb82 100644
--- a/xmake/core/tool/compiler.lua
+++ b/xmake/core/tool/compiler.lua
@@ -253,6 +253,35 @@ function compiler.kind_of_file(sourcefile)
return kinds[filetype:lower()]
end
+-- get the type of file
+function compiler.type_of_file(sourcefile)
+
+ -- get the source file type
+ local filetype = path.extension(sourcefile)
+ if not filetype then
+ return nil
+ end
+
+ -- the kinds
+ local kinds =
+ {
+ [".c"] = "source"
+ , [".cc"] = "source"
+ , [".cpp"] = "source"
+ , [".cxx"] = "source"
+ , [".h"] = "header"
+ , [".hpp"] = "header"
+ , [".m"] = "source"
+ , [".mm"] = "source"
+ , [".s"] = "source"
+ , [".asm"] = "source"
+ , [".swift"] = "source"
+ }
+
+ -- get kind
+ return kinds[filetype:lower()]
+end
+
-- get the current kind
function compiler:kind()