diff options
-rw-r--r-- | CMakeLists.txt | 16 |
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}) |