diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e8867bc3..a76c57768 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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. diff --git a/cmake/lws_config.h.in b/cmake/lws_config.h.in index e2b8cb074..5d2ac1290 100644 --- a/cmake/lws_config.h.in +++ b/cmake/lws_config.h.in @@ -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 diff --git a/lib/plat/unix/unix-sockets.c b/lib/plat/unix/unix-sockets.c index abdb07f9b..fa590f080 100644 --- a/lib/plat/unix/unix-sockets.c +++ b/lib/plat/unix/unix-sockets.c @@ -28,7 +28,11 @@ #include "private-lib-core.h" #include + +#if !defined(LWS_DETECTED_PLAT_IOS) #include +#endif + #include #include