summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-03-13 21:20:00 -0700
committerChris Robinson <[email protected]>2013-03-13 21:20:00 -0700
commit0423caeb8c182c2c68eecc158476abf97e9e9c78 (patch)
tree58c958e111b966653080b0e0b8d2644d1ee257e0
parentf1b0f67553f48eb03bc29678ace29df663f25029 (diff)
Use CHECK_SYMBOL_EXISTS to check for pthread_setschedparam
-rw-r--r--CMakeLists.txt16
1 files changed, 8 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09d7775f..35ba5651 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -377,12 +377,6 @@ IF(NOT HAVE_WINDOWS_H)
MESSAGE(FATAL_ERROR "No sleep function found!")
ENDIF()
- CHECK_C_COMPILER_FLAG(-pthread HAVE_PTHREAD)
- IF(HAVE_PTHREAD)
- ADD_DEFINITIONS(-pthread)
- SET(EXTRA_LIBS ${EXTRA_LIBS} -pthread)
- ENDIF()
-
# We need pthreads outside of Windows
CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
IF(NOT HAVE_PTHREAD_H)
@@ -391,6 +385,14 @@ IF(NOT HAVE_WINDOWS_H)
# Some systems need pthread_np.h to get recursive mutexes
CHECK_INCLUDE_FILES("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H)
+ CHECK_SYMBOL_EXISTS(pthread_setschedparam pthread.h HAVE_PTHREAD_SETSCHEDPARAM)
+
+ CHECK_C_COMPILER_FLAG(-pthread HAVE_PTHREAD)
+ IF(HAVE_PTHREAD)
+ ADD_DEFINITIONS(-pthread)
+ SET(EXTRA_LIBS ${EXTRA_LIBS} -pthread)
+ ENDIF()
+
# _GNU_SOURCE is needed on some systems for extra attributes
ADD_DEFINITIONS(-D_GNU_SOURCE=1)
CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_LIBPTHREAD)
@@ -398,8 +400,6 @@ IF(NOT HAVE_WINDOWS_H)
SET(EXTRA_LIBS pthread ${EXTRA_LIBS})
ENDIF()
- CHECK_LIBRARY_EXISTS(pthread pthread_setschedparam "" HAVE_PTHREAD_SETSCHEDPARAM)
-
CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_LIBRT)
IF(HAVE_LIBRT)
SET(EXTRA_LIBS rt ${EXTRA_LIBS})