bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.21k stars 4.06k forks source link

Accept .c++ as an extension for cc_library / cc_binary srcs #302

Closed kamalmarhubi closed 9 years ago

kamalmarhubi commented 9 years ago

I'm attempting to port a project that uses .c++ as its extension to build with Bazel. This is not included in the ALLOWED_SRC_FILES set. I couldn't find the CppFileTypes source that the constants come from, so don't know where to change it even for local testing of the build.

haxorz commented 9 years ago

Without answering your actual question (sorry, I don't work on this part of Bazel so I don't know what, if any, policy issues there are here*)...

I couldn't find the CppFileTypes source

I was also unable to find it via github search. Weird. Anyway, here it is:

https://github.com/google/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java

*That being said, I can't think of a good reason why we wouldn't want to allow this. E.g. 'srcs = ['foo.c++'] is completely legit from a syntax perspective (see http://bazel.io/docs/build-ref.html#lexi).

davidzchen commented 9 years ago

While this is a less-common file extension for C++ source files, it is used by a few projects, such as Capn Proto: https://github.com/sandstorm-io/capnproto/tree/master/c%2B%2B/src/capnp

kamalmarhubi commented 9 years ago

@haxorz thanks for the link to that bit of the source!

@davidzchen yeah, Cap'n Proto is the one I was looking to port :-)

damienmg commented 9 years ago

This is solved by 77ac48e2d0874d152c29b597113053f2629b3bc3