Have you tried using the LINK_PRIVATE signature to target link libraries?

On Wed, Oct 16, 2013 at 2:05 PM, James Bigler <[email protected]> wrote:
> Is it possible to stop known static libraries from being carried through
> shared libraries?
>
> add_library(mystatic1 STATIC ...)
> add_library(mystatic2 STATIC ...)
> add_library(myshared SHARED ...)
> target_link_libraries(myshared mystatic1 mystatic2)
> add_executable(myexe)
> target_link_libraries(myexe myshared)
>
> 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.
>
> I'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.
>
> James
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to