I have a shared library Main.so that publicly links against couple of open source and other static libraries publicly.
What I want to do is privately link all static libraries to shared library and control what symbols gets exposed and allow headers from these transitive static libraries be consumable by application/library linking against shared library
Is this possible?
Any example would be great
Here is roughly what i want to do
add_library(Shared SHARED shared.cpp)
add_library(Static STATIC1 static1.cpp)
add_library(Static STATIC2 static2.cpp)
add_library(Static STATIC3 static3.cpp)
include(GenerateExportHeader)
generate_export_header(Shared SHARED_NAME MY_SHARED)
target_link_libraries(Shared PRIVATE Static1 Static2 Static3)
add_executable(app app.cpp)
# app should be able to use headers/symbols from
# STATIC 1,2,3 as they were part of shared
# library
target_link_libraries(app Shared)