From 5bb3bea07b0ff38e4646ed6f835d9bdac6beced6 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 3 Aug 2017 14:51:41 +0200 Subject: build: Add check for robust mutexes This adds a check for robust mutexes. The constant HAVE_ROBUST_MUTEX is set accordingly in config.h. It also adds some other fixes to make the prototype compile on the Hurd. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c7266eb..85040496 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,12 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) find_package(ProtobufC REQUIRED) include_directories(${PROTOBUF_C_INCLUDE_DIRS}) +include(CheckSymbolExists) +list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=200809L) +list(APPEND CMAKE_REQUIRED_DEFINITIONS -D__XSI_VISIBLE=500) +list(APPEND CMAKE_REQUIRED_LIBRARIES pthread) +check_symbol_exists(pthread_mutexattr_setrobust pthread.h HAVE_ROBUST_MUTEX) + add_subdirectory(src) add_subdirectory(include) add_subdirectory(doc) -- cgit v1.2.3