summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2017-08-03 14:51:41 +0200
committerSander Vrijders <[email protected]>2017-08-03 15:19:16 +0200
commit5bb3bea07b0ff38e4646ed6f835d9bdac6beced6 (patch)
treeb071a0a3c396aa850a9024000a382165b0c00380 /CMakeLists.txt
parentb92eac2e9f6d686a9e2f748f8097aedbb373395c (diff)
downloadouroboros-5bb3bea07b0ff38e4646ed6f835d9bdac6beced6.tar.gz
ouroboros-5bb3bea07b0ff38e4646ed6f835d9bdac6beced6.zip
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.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
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)