Commit 3ff90e69 authored by Tom Stellard's avatar Tom Stellard
Browse files

Merging r294690:

------------------------------------------------------------------------
r294690 | ericwf | 2017-02-09 20:59:20 -0500 (Thu, 09 Feb 2017) | 13 lines

[CMake] Fix pthread handling for out-of-tree builds

LLVM defines `PTHREAD_LIB` which is used by AddLLVM.cmake and various projects
to correctly link the threading library when needed. Unfortunately
`PTHREAD_LIB` is defined by LLVM's `config-ix.cmake` file which isn't installed
and therefore can't be used when configuring out-of-tree builds. This causes
such builds to fail since `pthread` isn't being correctly linked.

This patch attempts to fix that problem by renaming and exporting
`LLVM_PTHREAD_LIB` as part of`LLVMConfig.cmake`. I renamed `PTHREAD_LIB`
because It seemed likely to cause collisions with downstream users of
`LLVMConfig.cmake`.

------------------------------------------------------------------------

llvm-svn: 303400
parent ab5d0b03
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ add_lld_library(lldCOFF

  LINK_LIBS
  lldCore
  ${PTHREAD_LIB}
  ${LLVM_PTHREAD_LIB}

  DEPENDS
  COFFOptionsTableGen
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ add_lld_library(lldELF
  LINK_LIBS
  lldConfig
  lldCore
  ${PTHREAD_LIB}
  ${LLVM_PTHREAD_LIB}

  DEPENDS
  ELFOptionsTableGen
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ add_lld_library(lldMachO
  LINK_LIBS
    lldCore
    lldYAML
    ${PTHREAD_LIB}
    ${LLVM_PTHREAD_LIB}
  )

include_directories(.)
+1 −1
Original line number Diff line number Diff line
@@ -3,5 +3,5 @@ add_lld_unittest(CoreTests
  )

target_link_libraries(CoreTests
  ${PTHREAD_LIB}
  ${LLVM_PTHREAD_LIB}
  )