You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
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