[CMake] FindThreads.cmake for Android

Gregory Peele ARA/CFD gpeele at ara.com
Tue Aug 9 13:28:51 EDT 2011


Hi all,

I noticed that FindThreads.cmake does not detect that Bionic (the Android C library) has pthreads built-in.   Adding the following snippet to the front of the pthreads section (after pthread.h is found) in FindThreads.cmake seems to handle this case correctly.

      CHECK_SYMBOL_EXISTS (pthread_create "pthread.h" CMAKE_HAVE_BUILTIN_PTHREAD_CREATE)
      IF (CMAKE_HAVE_BUILTIN_PTHREAD_CREATE)
                SET(CMAKE_USE_PTHREADS_INIT 1)
                SET(CMAKE_THREAD_LIBS_INIT )
                SET(CMAKE_HAVE_THREADS_LIBRARY 1)
                SET(Threads_FOUND TRUE)
      ENDIF ()

Should I file this in Mantis?

Gregory Peele, Jr.
Senior Scientist
Applied Research Associates, Inc.
Central Florida Division

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110809/ef64a181/attachment.htm>


More information about the CMake mailing list