summaryrefslogtreecommitdiffstats
path: root/Modules/FindThreads.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-09-20 21:21:23 (GMT)
committerBrad King <brad.king@kitware.com>2007-09-20 21:21:23 (GMT)
commit8481c4f1e9d6d81b5f741559146f2027d09bf5e5 (patch)
tree4427797ce9e68371231d2c60dbe730f07aa38dd6 /Modules/FindThreads.cmake
parent004c3639f48db5a05c6bbee03af23c4540830fbc (diff)
downloadCMake-8481c4f1e9d6d81b5f741559146f2027d09bf5e5.zip
CMake-8481c4f1e9d6d81b5f741559146f2027d09bf5e5.tar.gz
CMake-8481c4f1e9d6d81b5f741559146f2027d09bf5e5.tar.bz2
BUG: Do not use CMA threads on HP if they do not exist.
Diffstat (limited to 'Modules/FindThreads.cmake')
-rw-r--r--Modules/FindThreads.cmake11
1 files changed, 10 insertions, 1 deletions
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index 904f28c..f7c19b8 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -89,7 +89,16 @@ ENDIF(CMAKE_SYSTEM MATCHES "Windows")
IF(CMAKE_USE_PTHREADS_INIT)
IF(CMAKE_SYSTEM MATCHES "HP-UX-*")
- SET(CMAKE_THREAD_LIBS_INIT "-lcma")
+ # Use libcma if it exists and can be used. It provides more
+ # symbols than the plain pthread library. CMA threads
+ # have actually been deprecated:
+ # http://docs.hp.com/en/B3920-90091/ch12s03.html#d0e11395
+ # http://docs.hp.com/en/947/d8.html
+ # but we need to maintain compatibility here.
+ CHECK_LIBRARY_EXISTS(cma pthread_attr_create "" CMAKE_HAVE_HP_CMA)
+ IF(CMAKE_HAVE_HP_CMA)
+ SET(CMAKE_THREAD_LIBS_INIT "-lcma")
+ ENDIF(CMAKE_HAVE_HP_CMA)
SET(CMAKE_USE_PTHREADS_INIT 1)
SET(CMAKE_HP_PTHREADS_INIT 1)
ENDIF(CMAKE_SYSTEM MATCHES "HP-UX-*")