summaryrefslogtreecommitdiff
path: root/lib/Support/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/CMakeLists.txt')
-rw-r--r--lib/Support/CMakeLists.txt28
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt
index 1ba1c76f71..0b5f623d3a 100644
--- a/lib/Support/CMakeLists.txt
+++ b/lib/Support/CMakeLists.txt
@@ -118,5 +118,29 @@ add_llvm_library(LLVMSupport
Windows/TimeValue.inc
Windows/Watchdog.inc
)
-
-link_system_libs(LLVMSupport)
+set(system_libs)
+if( NOT MSVC )
+ if( MINGW )
+ set(system_libs ${system_libs} imagehlp psapi shell32)
+ elseif( CMAKE_HOST_UNIX )
+ if( HAVE_LIBRT )
+ set(system_libs ${system_libs} rt)
+ endif()
+ if( HAVE_LIBDL )
+ set(system_libs ${system_libs} ${CMAKE_DL_LIBS})
+ endif()
+ if(LLVM_ENABLE_TERMINFO)
+ if(HAVE_TERMINFO)
+ set(system_libs ${system_libs} ${TERMINFO_LIBS})
+ endif()
+ endif()
+ if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
+ set(system_libs ${system_libs} pthread)
+ endif()
+ if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
+ set(system_libs ${system_libs} z)
+ endif()
+ endif( MINGW )
+endif( NOT MSVC )
+target_link_libraries(LLVMSupport ${system_libs})
+set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")