summaryrefslogtreecommitdiff
path: root/lld/unittests
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-02-10 01:59:20 +0000
committerEric Fiselier <eric@efcs.ca>2017-02-10 01:59:20 +0000
commit8d602415530db6d5ed92a6dac20fd2f96ef0099d (patch)
treed5d8ba194a44bac218e40ce503579e8e46d652da /lld/unittests
parent355bd3bea0d1f9d0637dc9fb2b025912e6c3e394 (diff)
[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`.
Diffstat (limited to 'lld/unittests')
-rw-r--r--lld/unittests/CoreTests/CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/unittests/CoreTests/CMakeLists.txt b/lld/unittests/CoreTests/CMakeLists.txt
index 98405d5c73a..72e7c443f8c 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}
)