Author: phosek Date: Wed Jan 30 15:18:05 2019 New Revision: 352688 URL: http://llvm.org/viewvc/llvm-project?rev=352688&view=rev Log: [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 Modified: libunwind/trunk/src/CMakeLists.txt Modified: libunwind/trunk/src/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/CMakeLists.txt?rev=352688&r1=352687&r2=352688&view=diff ============================================================================== --- libunwind/trunk/src/CMakeLists.txt (original) +++ libunwind/trunk/src/CMakeLists.txt Wed Jan 30 15:18:05 2019 @@ -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}" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits