[cmake-commits] king committed FindThreads.cmake 1.16 1.17

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Sep 20 17:21:25 EDT 2007


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv24405

Modified Files:
	FindThreads.cmake 
Log Message:
BUG: Do not use CMA threads on HP if they do not exist.


Index: FindThreads.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindThreads.cmake,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- FindThreads.cmake	6 Aug 2007 15:02:58 -0000	1.16
+++ FindThreads.cmake	20 Sep 2007 21:21:23 -0000	1.17
@@ -89,7 +89,16 @@
 
 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-*")



More information about the Cmake-commits mailing list