diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2010-10-14 15:54:41 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2010-10-14 15:54:41 +0000 |
commit | 00a9618458d998688ae5846d44b17685ddeccc39 (patch) | |
tree | 9b3b81e5fc44e31c5b10dde6e89df33cf55eef8d | |
parent | 263cfecd4f0c115ee057ea02b5dca6506de6de63 (diff) | |
download | external_llvm-00a9618458d998688ae5846d44b17685ddeccc39.zip external_llvm-00a9618458d998688ae5846d44b17685ddeccc39.tar.gz external_llvm-00a9618458d998688ae5846d44b17685ddeccc39.tar.bz2 |
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
-rwxr-xr-x | cmake/modules/AddLLVM.cmake | 6 | ||||
-rw-r--r-- | lib/System/CMakeLists.txt | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 22a456e..b7ebe19 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}) diff --git a/lib/System/CMakeLists.txt b/lib/System/CMakeLists.txt index b43c3af..5c15f8e 100644 --- a/lib/System/CMakeLists.txt +++ b/lib/System/CMakeLists.txt @@ -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() |