summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-05-25 17:08:43 +0000
committerChris Bieneman <beanz@apple.com>2016-05-25 17:08:43 +0000
commitfdd7755743574f9adb33c90e1709bdf703a2e74c (patch)
tree7d180f284a1b2eb1d6d1471b90efd67f9d6de293 /cmake
parent06c03e57054537bc2576d25ec53a8f3e29058703 (diff)
[CMake] LINK_LIBS need to be public for Darwin dylib targets
This should actually address PR27855. This results in adding references to the system libs inside generated dylibs so that they get correctly pulled in when linking against the dylib. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270723 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/AddLLVM.cmake19
1 files changed, 7 insertions, 12 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 06d26673e96..573d8725106 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -489,25 +489,20 @@ function(llvm_add_library name)
if(CMAKE_VERSION VERSION_LESS 2.8.12)
# Link libs w/o keywords, assuming PUBLIC.
- target_link_libraries(${name}
- ${ARG_LINK_LIBS}
- ${lib_deps}
- ${llvm_libs}
- )
+ set(library_type)
elseif(ARG_STATIC)
- target_link_libraries(${name} INTERFACE
- ${ARG_LINK_LIBS}
- ${lib_deps}
- ${llvm_libs}
- )
+ set(library_type INTERFACE)
+ elseif(APPLE)
+ set(library_type PUBLIC)
else()
# We can use PRIVATE since SO knows its dependent libs.
- target_link_libraries(${name} PRIVATE
+ set(library_type PRIVATE)
+ endif()
+ target_link_libraries(${name} ${library_type}
${ARG_LINK_LIBS}
${lib_deps}
${llvm_libs}
)
- endif()
if(LLVM_COMMON_DEPENDS)
add_dependencies(${name} ${LLVM_COMMON_DEPENDS})