diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ec1d4860..9ed65804 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,21 +418,29 @@ 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(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -pthread") SET(EXTRA_LIBS ${EXTRA_LIBS} -pthread) ENDIF() # _GNU_SOURCE is needed on some systems for extra attributes ADD_DEFINITIONS(-D_GNU_SOURCE=1) + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_GNU_SOURCE=1") + CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_LIBPTHREAD) IF(HAVE_LIBPTHREAD) SET(EXTRA_LIBS pthread ${EXTRA_LIBS}) ENDIF() + CHECK_SYMBOL_EXISTS(pthread_setschedparam pthread.h HAVE_PTHREAD_SETSCHEDPARAM) + + CHECK_SYMBOL_EXISTS(pthread_setname_np pthread.h HAVE_PTHREAD_SETNAME_NP) + IF(NOT HAVE_PTHREAD_SETNAME_NP) + CHECK_SYMBOL_EXISTS(pthread_set_name_np pthread.h HAVE_PTHREAD_SET_NAME_NP) + ENDIF() + CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_LIBRT) IF(HAVE_LIBRT) SET(EXTRA_LIBS rt ${EXTRA_LIBS}) |