Explicitly check for pthread library, and link against it. stable-2.0
authorRyan C. Gordon <icculus@icculus.org>
Tue, 23 Oct 2012 14:37:52 -0400
branchstable-2.0
changeset 1308 ef4eaec5b8e2
parent 1307 f94eec5e9054
child 1314 305e3c4985d1
Explicitly check for pthread library, and link against it.
CMakeLists.txt
--- a/CMakeLists.txt	Mon Oct 22 23:41:04 2012 -0400
+++ b/CMakeLists.txt	Tue Oct 23 14:37:52 2012 -0400
@@ -170,6 +170,11 @@
         IF(HAVE_PTHREAD_H)
             SET(PHYSFS_HAVE_THREAD_SUPPORT TRUE)
         ENDIF(HAVE_PTHREAD_H)
+
+        FIND_LIBRARY(PTHREAD_LIBRARY pthread)
+        IF(PTHREAD_LIBRARY)
+            SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${PTHREAD_LIBRARY})
+        ENDIF(PTHREAD_LIBRARY)
     ENDIF(BEOS)
 ENDIF(UNIX)