1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

iOS: detect and avoid net/route.h

LWS builds OK on iOS SDK as unix type plat, except it
doesn't have net/route.h.

Detect we're building on iOS at CMake and export a
preprocessor define we can use to snip out the missing
include.
This commit is contained in:
huangkaicheng 2020-04-23 06:17:22 +01:00 committed by Andy Green
parent d9f793ae12
commit 974b65a2f0
3 changed files with 9 additions and 0 deletions

View file

@ -179,6 +179,10 @@ option(LWS_WITH_FANALYZER "Enable gcc -fanalyzer if compiler supports" OFF)
# End of user settings
#
if(IOS)
set(LWS_DETECTED_PLAT_IOS 1)
endif()
# Workaround for ESP-IDF
# Detect ESP_PLATFORM environment flag, if exist, set LWS_WITH_ESP32.
# Otherwise the user may not be able to run configuration ESP-IDF in the first time.

View file

@ -24,6 +24,7 @@
#cmakedefine LWS_BUILD_HASH "${LWS_BUILD_HASH}"
#cmakedefine LWS_BUILTIN_GETIFADDRS
#cmakedefine LWS_CLIENT_HTTP_PROXYING
#cmakedefine LWS_DETECTED_PLAT_IOS
#cmakedefine LWS_FALLBACK_GETHOSTBYNAME
#cmakedefine LWS_HAS_INTPTR_T
#cmakedefine LWS_HAS_GETOPT_LONG

View file

@ -28,7 +28,11 @@
#include "private-lib-core.h"
#include <sys/ioctl.h>
#if !defined(LWS_DETECTED_PLAT_IOS)
#include <net/route.h>
#endif
#include <net/if.h>
#include <pwd.h>