[PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 14 03:10:51 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL327490: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687) (authored by labath, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D44379?vs=138034&id=138316#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D44379

Files:
  lldb/trunk/cmake/modules/LLDBConfig.cmake


Index: lldb/trunk/cmake/modules/LLDBConfig.cmake
===================================================================
--- lldb/trunk/cmake/modules/LLDBConfig.cmake
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake
@@ -346,14 +346,18 @@
 
 endif()
 
-if (HAVE_LIBPTHREAD)
-  list(APPEND system_libs pthread)
-endif(HAVE_LIBPTHREAD)
+if( WIN32 AND NOT CYGWIN )
+  set(PURE_WINDOWS 1)
+endif()
 
-if (HAVE_LIBDL)
-  list(APPEND system_libs ${CMAKE_DL_LIBS})
+if(NOT PURE_WINDOWS)
+  set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+  find_package(Threads REQUIRED)
+  list(APPEND system_libs ${CMAKE_THREAD_LIBS_INIT})
 endif()
 
+list(APPEND system_libs ${CMAKE_DL_LIBS})
+
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
 if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44379.138316.patch
Type: text/x-patch
Size: 858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180314/eafdcdea/attachment.bin>


More information about the llvm-commits mailing list