Fix for PR18921 (LDRD/STRD part)::
[oota-llvm.git] / lib / Support / CMakeLists.txt
index 5d533dea6589b0535c5d062507eda61400dd4e0b..b4c674d32e277198303734cdbfec7b57f48180f6 100644 (file)
@@ -9,7 +9,6 @@ add_llvm_library(LLVMSupport
   circular_raw_ostream.cpp
   CommandLine.cpp
   Compression.cpp
-  ConstantRange.cpp
   ConvertUTF.c
   ConvertUTFWrapper.cpp
   CrashRecoveryContext.cpp
@@ -31,6 +30,7 @@ add_llvm_library(LLVMSupport
   IntrusiveRefCntPtr.cpp
   IsInf.cpp
   IsNAN.cpp
+  LEB128.cpp
   LineIterator.cpp
   Locale.cpp
   LockFileManager.cpp
@@ -117,5 +117,37 @@ add_llvm_library(LLVMSupport
   Windows/TimeValue.inc
   Windows/Watchdog.inc
   )
+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 )
 
-link_system_libs(LLVMSupport)
+
+if(POLICY CMP0022 AND BUILD_SHARED_LIBS)
+  # FIXME: Should this be really PUBLIC?
+  target_link_libraries(LLVMSupport PUBLIC ${system_libs})
+else()
+  target_link_libraries(LLVMSupport ${cmake_2_8_12_INTERFACE} ${system_libs})
+endif()
+
+set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")