diff --git a/lib/core/context.c b/lib/core/context.c index 69924d44d..9d0de5bee 100644 --- a/lib/core/context.c +++ b/lib/core/context.c @@ -563,6 +563,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) @@ -571,6 +576,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) @@ -579,6 +589,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) @@ -587,6 +602,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) @@ -595,6 +615,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) @@ -603,6 +628,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 */