1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "tools/gn/source_file_type.h"
7 #include "tools/gn/filesystem_utils.h"
8 #include "tools/gn/source_file.h"
10 SourceFileType
GetSourceFileType(const SourceFile
& file
) {
11 base::StringPiece extension
= FindExtension(&file
.value());
12 if (extension
== "cc" || extension
== "cpp" || extension
== "cxx")
20 if (extension
== "mm")
22 if (extension
== "rc")
24 if (extension
== "S" || extension
== "s" || extension
== "asm")
26 if (extension
== "o" || extension
== "obj")
28 if (extension
== "def")
31 return SOURCE_UNKNOWN
;