jcheca / rpms / clang

Forked from rpms/clang 2 years ago
Clone
5617ce0
From f5f712dfcac6ee99381c5aca212950276f1743e8 Mon Sep 17 00:00:00 2001
5617ce0
From: Eric Fiselier <eric@efcs.ca>
5617ce0
Date: Fri, 10 Feb 2017 01:59:20 +0000
5617ce0
Subject: [PATCH] [CMake] Fix pthread handling for out-of-tree builds
5617ce0
5617ce0
LLVM defines `PTHREAD_LIB` which is used by AddLLVM.cmake and various projects
5617ce0
to correctly link the threading library when needed. Unfortunately
5617ce0
`PTHREAD_LIB` is defined by LLVM's `config-ix.cmake` file which isn't installed
5617ce0
and therefore can't be used when configuring out-of-tree builds. This causes
5617ce0
such builds to fail since `pthread` isn't being correctly linked.
5617ce0
5617ce0
This patch attempts to fix that problem by renaming and exporting
5617ce0
`LLVM_PTHREAD_LIB` as part of`LLVMConfig.cmake`. I renamed `PTHREAD_LIB`
5617ce0
because It seemed likely to cause collisions with downstream users of
5617ce0
`LLVMConfig.cmake`.
5617ce0
5617ce0
5617ce0
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@294690 91177308-0d34-0410-b5e6-96231b3b80d8
5617ce0
---
5617ce0
 include-fixer/plugin/CMakeLists.txt | 2 +-
5617ce0
 1 file changed, 1 insertion(+), 1 deletion(-)
5617ce0
5617ce0
diff --git a/include-fixer/plugin/CMakeLists.txt b/include-fixer/plugin/CMakeLists.txt
5617ce0
index 2799fd4..df792ea 100644
5617ce0
--- a/include-fixer/plugin/CMakeLists.txt
5617ce0
+++ b/include-fixer/plugin/CMakeLists.txt
5617ce0
@@ -9,5 +9,5 @@ add_clang_library(clangIncludeFixerPlugin
5617ce0
   clangParse
5617ce0
   clangSema
5617ce0
   clangTooling
5617ce0
-  ${PTHREAD_LIB}
5617ce0
+  ${LLVM_PTHREAD_LIB}
5617ce0
   )
5617ce0
-- 
5617ce0
1.8.3.1
5617ce0