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.
This commit is contained in:
Brad King 2016-08-25 13:43:50 -04:00
parent 8a5beef32e
commit 219f741128
1 changed files with 14 additions and 0 deletions

View File

@ -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 <CoreServices/CoreServices.h>
#include <AvailabilityMacros.h>
#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)