diff options
| author | enorof <[email protected]> | 2016-09-16 20:36:50 +0800 |
|---|---|---|
| committer | enorof <[email protected]> | 2016-09-16 20:36:50 +0800 |
| commit | e15e08d70cadfe3d6d3b42756cb92ff4ac77ba61 (patch) | |
| tree | 87049136b99c4db16c4108baeb3ad4eb7feec4d6 /xmake/core/tool/compiler.lua | |
| parent | 252f501054ab2058320319a1cb9f749858b6776c (diff) | |
add filters for vs201x project.
Diffstat (limited to 'xmake/core/tool/compiler.lua')
| -rw-r--r-- | xmake/core/tool/compiler.lua | 29 |
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() |
