summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-25 13:43:50 -0400
committerBrad King <brad.king@kitware.com>2016-08-31 09:05:14 -0400
commit219f741128bfe1f34a97d71fa3bcdf8588d3d890 (patch)
tree67a1fcd8182b8dd01006ef8ec88116bd17a944da /CMakeLists.txt
parent8a5beef32e007e69a8b348afa8ed2bddd760199a (diff)
downloadcmake-219f741128bfe1f34a97d71fa3bcdf8588d3d890.tar.gz
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.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 13e2401782..b62f6a5891 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 <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)