OSDN Git Service

When building shared libraries, link to required system libraries.
authorOscar Fuentes <ofv@wanadoo.es>
Thu, 14 Oct 2010 15:54:41 +0000 (15:54 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Thu, 14 Oct 2010 15:54:41 +0000 (15:54 +0000)
PR 8375

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116479 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/AddLLVM.cmake
lib/System/CMakeLists.txt

index 22a456e..b7ebe19 100755 (executable)
@@ -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})
index b43c3af..5c15f8e 100644 (file)
@@ -42,7 +42,3 @@ add_llvm_library(LLVMSystem
   Win32/ThreadLocal.inc
   Win32/TimeValue.inc
   )
-
-if( BUILD_SHARED_LIBS AND NOT WIN32 )
-  target_link_libraries(LLVMSystem ${CMAKE_DL_LIBS})
-endif()