diff options
author | Tom Stellard <tstellar@redhat.com> | 2017-05-19 01:55:37 +0000 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2017-05-19 01:55:37 +0000 |
commit | 3ff90e690e57ce0dd1a4526abd5f88003facb889 (patch) | |
tree | 1f5f6e059ad53cd563b6f3885d008279cd0159db | |
parent | ab5d0b03e4746e82c1a51e30cf4c0bd8b6831970 (diff) |
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
-rw-r--r-- | lld/COFF/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lld/ELF/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/MachO/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lld/unittests/CoreTests/CMakeLists.txt | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/lld/COFF/CMakeLists.txt b/lld/COFF/CMakeLists.txt index 70a33b9fdd81..d51750fbfcf8 100644 --- a/lld/COFF/CMakeLists.txt +++ b/lld/COFF/CMakeLists.txt @@ -40,7 +40,7 @@ add_lld_library(lldCOFF LINK_LIBS lldCore - ${PTHREAD_LIB} + ${LLVM_PTHREAD_LIB} DEPENDS COFFOptionsTableGen diff --git a/lld/ELF/CMakeLists.txt b/lld/ELF/CMakeLists.txt index 2e9d2b941fd9..6c67661d8b57 100644 --- a/lld/ELF/CMakeLists.txt +++ b/lld/ELF/CMakeLists.txt @@ -53,7 +53,7 @@ add_lld_library(lldELF LINK_LIBS lldConfig lldCore - ${PTHREAD_LIB} + ${LLVM_PTHREAD_LIB} DEPENDS ELFOptionsTableGen diff --git a/lld/lib/ReaderWriter/MachO/CMakeLists.txt b/lld/lib/ReaderWriter/MachO/CMakeLists.txt index 3b0698525aa5..5a96d87f1f7a 100644 --- a/lld/lib/ReaderWriter/MachO/CMakeLists.txt +++ b/lld/lib/ReaderWriter/MachO/CMakeLists.txt @@ -28,7 +28,7 @@ add_lld_library(lldMachO LINK_LIBS lldCore lldYAML - ${PTHREAD_LIB} + ${LLVM_PTHREAD_LIB} ) include_directories(.) diff --git a/lld/unittests/CoreTests/CMakeLists.txt b/lld/unittests/CoreTests/CMakeLists.txt index 98405d5c73a1..72e7c443f8cd 100644 --- a/lld/unittests/CoreTests/CMakeLists.txt +++ b/lld/unittests/CoreTests/CMakeLists.txt @@ -3,5 +3,5 @@ add_lld_unittest(CoreTests ) target_link_libraries(CoreTests - ${PTHREAD_LIB} + ${LLVM_PTHREAD_LIB} ) |