I’m curious how the use of the PUBLIC flag in target_link_libraries actually works. As an example, say I create a library libA.so which depends on libB.so. Some elements of libB.so are in the public interface of A, so I configure it with cmake thusly:
target_link_library(A PUBLIC B)
Now, someone creates a library libUserLibrary.so and wants to use my library A. They link against it, and thereby libUserLibrary.so links against both libA.so and libB.so.
How is this actually done with the C++ linker?