We have a very big codebase (more than 3K translation units) and despite it being subdivided into small libraries, there is no distinction between private headers and public headers.
We use CMake as a build system and we are building on Linux, so my understanding is that every symbol is exported by default and when the linker has to choose which symbol to link, it has to choose among all of them, even those which are not really part of a library public interface.
If we would separate for each library which headers are private and which headers are public, and heavily use CMake PUBLIC
and CMake PRIVATE
dependency type when expressing dependencies among libraries, would there be any benefit in terms of linking time? Or would it still be the case that the linker just sees everything and has to perform a full search?