From 9521339c2e143d9eca75dc6120feb29842df8d36 Mon Sep 17 00:00:00 2001 From: zlargon Date: Sun, 7 Apr 2019 12:47:04 -0400 Subject: [PATCH] build: use cmake APPLE variable to detect platform - CMake 3.14: supports Cross Compiling for iOS, tvOS, or watchOS using simple toolchain files. https://cmake.org/cmake/help/v3.14/release/3.14.html#platforms - CMake 3.10: APPLE variable set to TURE when the target system is an Apple platform (macOS, iOS, tvOS or watchOS). https://cmake.org/cmake/help/v3.10/variable/APPLE.html - CMake 3.0: APPLE variable support since v3.0. https://cmake.org/cmake/help/v3.0/variable/APPLE.html PR-URL: https://github.com/libuv/libuv/pull/2245 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a2a3f67..7b255119 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,7 +264,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android") src/unix/sysinfo-memory.c) endif() -if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|OS/390") +if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux|OS/390") list(APPEND uv_sources src/unix/proctitle.c) endif() @@ -277,11 +277,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|NetBSD|OpenBSD") list(APPEND uv_libraries kvm) endif() -if(CMAKE_SYSTEM_NAME MATCHES "Darwin|DragonFly|FreeBSD|NetBSD|OpenBSD") +if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|NetBSD|OpenBSD") list(APPEND uv_sources src/unix/bsd-ifaddrs.c src/unix/kqueue.c) endif() -if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") +if(APPLE) list(APPEND uv_defines _DARWIN_UNLIMITED_SELECT=1 _DARWIN_USE_64_BIT_INODE=1) list(APPEND uv_sources src/unix/darwin-proctitle.c @@ -335,7 +335,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") list(APPEND uv_sources src/unix/no-proctitle.c src/unix/sunos.c) endif() -if(CMAKE_SYSTEM_NAME MATCHES "Darwin|DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") +if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD") list(APPEND uv_test_libraries util) endif()