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

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 12 09:29:09 PDT 2018


labath updated this revision to Diff 138034.
labath added a comment.

This drops the LLDBStandalone changes (they are replaced by https://reviews.llvm.org/D44391 on the llvm
side), and simplifies the CMAKE_DL_LIBS logic.

I've tested this out both with BUILD_SHARED_LIBS and LLVM_LINK_LLVM_DYLIB builds
(for the latter, be sure to specify LLVM_LINK_LLVM_DYLIB also when configuring
lldb), but I'd appreciate more testing (I'm no hurry to land this).


https://reviews.llvm.org/D44379

Files:
  cmake/modules/LLDBConfig.cmake


Index: cmake/modules/LLDBConfig.cmake
===================================================================
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -346,14 +346,14 @@
 
 endif()
 
-if (HAVE_LIBPTHREAD)
-  list(APPEND system_libs pthread)
-endif(HAVE_LIBPTHREAD)
-
-if (HAVE_LIBDL)
-  list(APPEND system_libs ${CMAKE_DL_LIBS})
+if(UNIX)
+  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.138034.patch
Type: text/x-patch
Size: 753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180312/505aee9f/attachment.bin>


More information about the lldb-commits mailing list