From 219f741128bfe1f34a97d71fa3bcdf8588d3d890 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 25 Aug 2016 13:43:50 -0400 Subject: [PATCH] Do not build libuv on Mac OS X 10.4 and lower It needs APIs that have been available only since 10.5. Also check that the CoreServices header can be included. --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 13e240178..b62f6a589 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -468,6 +468,20 @@ macro (CMAKE_BUILD_UTILITIES) # Build libuv library. if(NOT DEFINED CMAKE_USE_LIBUV) set(CMAKE_USE_LIBUV 1) + if(APPLE) + include(CheckCSourceCompiles) + check_c_source_compiles(" +#include +#include +#ifndef MAC_OS_X_VERSION_10_5 +#error \"MAC_OS_X_VERSION_10_5 is not defined\" +#endif +int main(void) { return 0; } +" HAVE_CoreServices_OS_X_10_5) + if(NOT HAVE_CoreServices_OS_X_10_5) + set(CMAKE_USE_LIBUV 0) + endif() + endif() endif() if(CMAKE_USE_LIBUV) if(CMAKE_USE_SYSTEM_LIBUV)