Allow ".c++" as a C++ source file extension Some projects use .c++ as an extension for C++ source files, for example: https://github.com/capnproto/capnproto Adding this suffix allows these source files to appear in source_sets and makes it possible to build these projects using gn without needing to make invasive changes to them. Change-Id: Ie036ffc81510e79643db2674ee4b39cd5cc9691f Reviewed-on: https://gn-review.googlesource.com/c/gn/+/9800 Reviewed-by: Brett Wilson <brettw@chromium.org> Commit-Queue: Brett Wilson <brettw@chromium.org>
diff --git a/src/gn/source_file.cc b/src/gn/source_file.cc index 89c8cf0..52066d7 100644 --- a/src/gn/source_file.cc +++ b/src/gn/source_file.cc
@@ -23,7 +23,8 @@ SourceFile::Type GetSourceFileType(const std::string& file) { std::string_view extension = FindExtension(&file); - if (extension == "cc" || extension == "cpp" || extension == "cxx") + if (extension == "cc" || extension == "cpp" || extension == "cxx" || + extension == "c++") return SourceFile::SOURCE_CPP; if (extension == "h" || extension == "hpp" || extension == "hxx" || extension == "hh" || extension == "inc" || extension == "ipp" ||