diff options
author | Petr Hosek <phosek@chromium.org> | 2019-01-30 19:27:26 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2019-01-30 19:27:26 +0000 |
commit | b9128d8def879775838876af43592da01ecbc18d (patch) | |
tree | f65056a87200ab2429ea6c09b429015d53363f6a /libcxx/lib | |
parent | c71e996aed8143ea6d27ee49b5caee07db48a031 (diff) | |
download | bcm5719-llvm-b9128d8def879775838876af43592da01ecbc18d.tar.gz bcm5719-llvm-b9128d8def879775838876af43592da01ecbc18d.zip |
[CMake] Use correct visibility for linked libraries in CMake
When linking library dependencies, we shouldn't need to export linked
libraries to dependents. We should be explicit about this in
target_link_libraries, otherwise other targets that depend on these such
as sanitizers get repeated (and possibly even conflicting) dependencies.
Differential Revision: https://reviews.llvm.org/D57456
llvm-svn: 352654
Diffstat (limited to 'libcxx/lib')
-rw-r--r-- | libcxx/lib/CMakeLists.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/lib/CMakeLists.txt b/libcxx/lib/CMakeLists.txt index 24489e8fb5e..79ea8d92a35 100644 --- a/libcxx/lib/CMakeLists.txt +++ b/libcxx/lib/CMakeLists.txt @@ -241,7 +241,7 @@ if (LIBCXX_ENABLE_SHARED) if(COMMAND llvm_setup_rpath) llvm_setup_rpath(cxx_shared) endif() - target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES}) + target_link_libraries(cxx_shared PRIVATE ${LIBCXX_LIBRARIES}) set_target_properties(cxx_shared PROPERTIES LINK_FLAGS "${LIBCXX_LINK_FLAGS}" @@ -265,7 +265,7 @@ endif() # Build the static library. if (LIBCXX_ENABLE_STATIC) add_library(cxx_static STATIC ${cxx_static_sources}) - target_link_libraries(cxx_static ${LIBCXX_LIBRARIES}) + target_link_libraries(cxx_static PRIVATE ${LIBCXX_LIBRARIES}) set(CMAKE_STATIC_LIBRARY_PREFIX "lib") set_target_properties(cxx_static PROPERTIES |