[clang-tools-extra] r294690 - [CMake] Fix pthread handling for out-of-tree builds

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 9 17:59:24 PST 2017


Author: ericwf
Date: Thu Feb  9 19:59:20 2017
New Revision: 294690

URL: http://llvm.org/viewvc/llvm-project?rev=294690&view=rev
Log:
[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`.

Modified:
    clang-tools-extra/trunk/include-fixer/plugin/CMakeLists.txt

Modified: clang-tools-extra/trunk/include-fixer/plugin/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/plugin/CMakeLists.txt?rev=294690&r1=294689&r2=294690&view=diff
==============================================================================
--- clang-tools-extra/trunk/include-fixer/plugin/CMakeLists.txt (original)
+++ clang-tools-extra/trunk/include-fixer/plugin/CMakeLists.txt Thu Feb  9 19:59:20 2017
@@ -9,5 +9,5 @@ add_clang_library(clangIncludeFixerPlugi
   clangParse
   clangSema
   clangTooling
-  ${PTHREAD_LIB}
+  ${LLVM_PTHREAD_LIB}
   )




More information about the cfe-commits mailing list