> On 19. Jan 2022, at 09:30, Konstantin Shegunov <kshegu...@gmail.com> wrote:
> 
> 
> Oh, I just took the easy (perhaps wrong) approach. I pushed from the backing 
> target to the consumer a cpp file, which is a dummy containing the pointer 
> thing. It just contains (Tsc.Ui is my module's URI):

I assume you mean you did target_sources(tsc_ui_target INTERFACE dummy.cpp)
target_link_libraries(your_shared_lib PRIVATE tsc_ui_target)

It does work if the direct consumer is a shared lib.

That doesn't quite work if the consuming target is a static lib, that is then 
linked into an executable/shared lib.
 dummy.o will be archived into the static lib and then discarded when linked 
into a shared lib because nothing is referencing symbols from that object file.

Hence the need for object libraries instead of target_sources.. Hence the need 
for CMake 3.21.





_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to