From 72643e283c3f6fdc452a75d939ab975c22867fc5 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 7 Oct 2016 23:28:01 +0200 Subject: [PATCH] OS X El Capitan deprecates the sem_init() function --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 766957c793..d37c886a53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -303,7 +303,9 @@ endif() CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_POSIX_GETTIME) CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_PTHREAD) -CHECK_LIBRARY_EXISTS(pthread sem_init "" HAVE_SEM_INIT_LIB) +if(NOT APPLE) # OS X El Capitan deprecates this function + CHECK_LIBRARY_EXISTS(pthread sem_init "" HAVE_SEM_INIT_LIB) +endif() CHECK_LIBRARY_EXISTS(pthread sem_open "" HAVE_SEM_OPEN_LIB) set(HAVE_PTHREAD_SETAFFINITY 0) CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "" HAVE_PTHREAD_SETAFFINITY) @@ -537,6 +539,8 @@ if(HAVE_PTHREAD) endif() endif() file(REMOVE sem_init) + else() + set(HAVE_SEM_INIT 0) endif() if(NOT HAVE_SEM_OPEN AND NOT HAVE_SEM_INIT) -- 2.20.1