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:
parent
d9f793ae12
commit
974b65a2f0
3 changed files with 9 additions and 0 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue