diff --git a/lib/core/context.c b/lib/core/context.c index cdbcec883..a733ee38c 100644 --- a/lib/core/context.c +++ b/lib/core/context.c @@ -542,6 +542,11 @@ lws_create_context(const struct lws_context_creation_info *info) fatal_exit_defer = !!info->foreign_loops; us_wait_resolution = 0; } +#else + if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBUV)) { + lwsl_cx_err(context, "Application wants libuv, but lws not built with it"); + goto bail; + } #endif #if defined(LWS_WITH_LIBEVENT) @@ -550,6 +555,11 @@ lws_create_context(const struct lws_context_creation_info *info) plev = &evlib_event; us_wait_resolution = 0; } +#else + if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBEVENT)) { + lwsl_cx_err(context, "Application wants libevent, but lws not built with it"); + goto bail; + } #endif #if defined(LWS_WITH_GLIB) @@ -558,6 +568,11 @@ lws_create_context(const struct lws_context_creation_info *info) plev = &evlib_glib; us_wait_resolution = 0; } +#else + if (lws_check_opt(info->options, LWS_SERVER_OPTION_GLIB)) { + lwsl_cx_err(context, "Application wants glib, but lws not built with it"); + goto bail; + } #endif #if defined(LWS_WITH_LIBEV) @@ -566,6 +581,11 @@ lws_create_context(const struct lws_context_creation_info *info) plev = &evlib_ev; us_wait_resolution = 0; } +#else + if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBEV)) { + lwsl_cx_err(context, "Application wants libev, but lws not built with it"); + goto bail; + } #endif #if defined(LWS_WITH_SDEVENT) @@ -574,6 +594,11 @@ lws_create_context(const struct lws_context_creation_info *info) plev = &evlib_sd; us_wait_resolution = 0; } +#else + if (lws_check_opt(info->options, LWS_SERVER_OPTION_SDEVENT)) { + lwsl_cx_err(context, "Application wants sdevent, but lws not built with it"); + goto bail; + } #endif #if defined(LWS_WITH_ULOOP) @@ -582,6 +607,11 @@ lws_create_context(const struct lws_context_creation_info *info) plev = &evlib_uloop; us_wait_resolution = 0; } +#else + if (lws_check_opt(info->options, LWS_SERVER_OPTION_ULOOP)) { + lwsl_cx_err(context, "Application wants uloop, but lws not built with it"); + goto bail; + } #endif #endif /* with event libs */