diff options
author | Petr Hosek <phosek@chromium.org> | 2019-01-30 23:18:05 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2019-01-30 23:18:05 +0000 |
commit | 28438a8c777e2b803918d7c738e90470f60387fe (patch) | |
tree | 7784abcdb4d97bf31e05e4d052f8eca4a780823e | |
parent | 6020f994d6168b5f3257baa12b0d63a8b83eebac (diff) | |
download | libunwind_llvm-28438a8c777e2b803918d7c738e90470f60387fe.tar.gz |
[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
git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@352688 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | src/CMakeLists.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 080e8c5..2928a14 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -146,7 +146,7 @@ if (LIBUNWIND_ENABLE_SHARED) if(COMMAND llvm_setup_rpath) llvm_setup_rpath(unwind_shared) endif() - target_link_libraries(unwind_shared ${libraries}) + target_link_libraries(unwind_shared PRIVATE ${libraries}) set_target_properties(unwind_shared PROPERTIES LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}" @@ -162,7 +162,7 @@ endif() # Build the static library. if (LIBUNWIND_ENABLE_STATIC) add_library(unwind_static STATIC ${unwind_static_sources}) - target_link_libraries(unwind_static ${libraries}) + target_link_libraries(unwind_static PRIVATE ${libraries}) set_target_properties(unwind_static PROPERTIES LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}" |