From da771539c1e11fa5a699eb8285977ea8e1a3bde5 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 19 Jul 2021 22:35:31 +0200 Subject: [PATCH] fix cross-build to iOS/tvOS/watchOS --- miniupnpc/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miniupnpc/CMakeLists.txt b/miniupnpc/CMakeLists.txt index 7fe7fcf..e1803de 100644 --- a/miniupnpc/CMakeLists.txt +++ b/miniupnpc/CMakeLists.txt @@ -29,7 +29,7 @@ if (NOT WIN32) target_compile_definitions(miniupnpc-private INTERFACE MINIUPNPC_SET_SOCKET_TIMEOUT _BSD_SOURCE _DEFAULT_SOURCE) - if (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") + if (NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") # add_definitions (-D_POSIX_C_SOURCE=200112L) target_compile_definitions(miniupnpc-private INTERFACE _XOPEN_SOURCE=600) endif () @@ -37,7 +37,7 @@ else () target_compile_definitions(miniupnpc-private INTERFACE _WIN32_WINNT=0x0501) # XP or higher for getnameinfo and friends endif () -if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") +if (APPLE) target_compile_definitions(miniupnpc-private INTERFACE _DARWIN_C_SOURCE) endif ()