From 369799644bb0536ce104e84eefde3938d4a0abd0 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 9 Feb 2015 10:12:59 +0000 Subject: [PATCH] One more push to pthread_mutexattr_setpshared --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ca788594..050117b4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -760,14 +760,18 @@ FILE(WRITE ${CMAKE_BINARY_DIR}/pthread_setpshared.c " #include int main (void) { - pthread_mutex_attr_t mattr; + pthread_mutexattr_t mattr; if (pthread_mutexattr_init(&mattr) != 0) return 0; if (pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED) != 0) return 0; return 1; } ") -TRY_RUN(HAVE_PTHREAD_PROCESS_SHARED _CAN_COMPILE - "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/pthread_setpshared.c") +TRY_RUN(_CAN_RUN _CAN_COMPILE + "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/pthread_setpshared.c" + CMAKE_FLAGS CMAKE_C_FLAGS="-pthread") +IF(_CAN_RUN EQUAL 1) + SET(HAVE_PTHREAD_PROCESS_SHARED) +ENDIF(_CAN_RUN EQUAL 1) IF(HAVE_PTHREAD_PROCESS_SHARED) MESSAGE(STATUS "pthread_mutexattr_setpshared is supported") ELSE(HAVE_PTHREAD_PROCESS_SHARED) -- 2.39.5