From 0423caeb8c182c2c68eecc158476abf97e9e9c78 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 13 Mar 2013 21:20:00 -0700 Subject: Use CHECK_SYMBOL_EXISTS to check for pthread_setschedparam --- CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'CMakeLists.txt') 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}) -- cgit v1.2.3