summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2010-10-14 15:54:41 +0000
committerOscar Fuentes <ofv@wanadoo.es>2010-10-14 15:54:41 +0000
commit00a9618458d998688ae5846d44b17685ddeccc39 (patch)
tree9b3b81e5fc44e31c5b10dde6e89df33cf55eef8d /cmake
parent263cfecd4f0c115ee057ea02b5dca6506de6de63 (diff)
downloadllvm-00a9618458d998688ae5846d44b17685ddeccc39.tar.gz
llvm-00a9618458d998688ae5846d44b17685ddeccc39.tar.bz2
llvm-00a9618458d998688ae5846d44b17685ddeccc39.tar.xz
When building shared libraries, link to required system libraries.
PR 8375 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116479 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/modules/AddLLVM.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 22a456e460..b7ebe192fc 100755
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -9,6 +9,12 @@ macro(add_llvm_library name)
if( LLVM_COMMON_DEPENDS )
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
endif( LLVM_COMMON_DEPENDS )
+
+ if( BUILD_SHARED_LIBS )
+ get_system_libs(sl)
+ target_link_libraries( ${name} ${sl} )
+ endif()
+
install(TARGETS ${name}
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})