<div dir="ltr">Is it possible to stop known static libraries from being carried through shared libraries?<div><br></div><div>add_library(mystatic1 STATIC ...)</div><div>add_library(mystatic2 STATIC ...)</div><div>add_library(myshared SHARED ...)</div>

<div>target_link_libraries(myshared mystatic1 mystatic2)</div><div>add_executable(myexe)</div><div>target_link_libraries(myexe myshared)</div><div><br></div><div>Once a shared library is created, all the information about what libraries are needed should be encoded in the shared library.  In addition if myexe links against only myshared then only the symbols being exported by myshared should be visible to myexe.</div>

<div><br></div><div>I&#39;m seeing problems where symbols from mystatic1 are being seen by myexe, when myexe should only be seeing symbols from myshared.  This is because CMake links myshared, mystatic1, and mystatic2 to myexe all in the same link line.</div>

<div><br></div><div>James</div></div>