Inconsistent .tpp behaviour for c++ #26050
Unanswered
Attempt3035
asked this question in
Q&A
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all!
We have a c++ project that heavily uses templating, with template definitions put into .tpp files (which are included at the end of the relevant .h file) to keep things neat and tidy.
Bazel accepts and compiles the project fine when the .tpp is put into hdrs, but complains (.tpp is misplaced here) when it is in .srcs
We want to be able to put select .tpp (the same as we do with .h, they should behave identically) in .srcs so that it isn't publicly exposed as a header to a user of the library.
Is there any reason for this design choice, or is it just inconsistency with how header files with different extensions are handled between .srcs and .hdrs?
Currently to solve this, we put the .tpp files in the hdrs of a private cc_library, which is included as a dep of the main library as to not be exposed as a header of the main lib.
Beta Was this translation helpful? Give feedback.
All reactions