Repository: qpid-dispatch Updated Branches: refs/heads/master 892a413f8 -> 33feac55c
DISPATCH-893: Compile fails using libwebsockets 7 Updated cmake files to require libwebsockets 2.1.0, the earliest version known to work. If we need HTTP support on platforms that don't support it, we should reconsider our options. Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/33feac55 Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/33feac55 Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/33feac55 Branch: refs/heads/master Commit: 33feac55c690a9b7c7e7e251deb076a14b5692f2 Parents: 892a413 Author: Alan Conway <[email protected]> Authored: Tue Jan 2 16:36:38 2018 -0500 Committer: Alan Conway <[email protected]> Committed: Tue Jan 2 16:36:38 2018 -0500 ---------------------------------------------------------------------- cmake/FindLibWebSockets.cmake | 22 ++++++++++++++++++---- src/http-none.c | 2 ++ 2 files changed, 20 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/33feac55/cmake/FindLibWebSockets.cmake ---------------------------------------------------------------------- diff --git a/cmake/FindLibWebSockets.cmake b/cmake/FindLibWebSockets.cmake index a15d0d2..c5f6254 100644 --- a/cmake/FindLibWebSockets.cmake +++ b/cmake/FindLibWebSockets.cmake @@ -23,7 +23,8 @@ # # LIBWEBSOCKETS_FOUND - True if headers and requested libraries were found # LIBWEBSOCKETS_INCLUDE_DIRS - LibWebSockets include directories -# LIBWEBSOCKETS_LIBRARIES - Link these to use libwebsockets. +# LIBWEBSOCKETS_LIBRARIES - Link these to use libwebsockets +# LIBWEBSOCKETS_VERSION_STRING - The library version number # # This module reads hints about search locations from variables:: # LIBWEBSOCKETS_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib @@ -42,12 +43,25 @@ find_path(LIBWEBSOCKETS_INCLUDE_DIRS PATHS /usr/include ) -include(FindPackageHandleStandardArgs) +if(LIBWEBSOCKETS_INCLUDE_DIRS AND EXISTS "${LIBWEBSOCKETS_INCLUDE_DIRS}/lws_config.h") + file(STRINGS "${LIBWEBSOCKETS_INCLUDE_DIRS}/lws_config.h" lws_version_str + REGEX "^#define[ \t]+LWS_LIBRARY_VERSION[ \t]+\"[^\"]+\"") + string(REGEX REPLACE "^#define[ \t]+LWS_LIBRARY_VERSION[ \t]+\"([^\"]+)\".*" "\\1" + LIBWEBSOCKETS_VERSION_STRING "${lws_version_str}") + unset(lws_version_str) +endif() -find_package_handle_standard_args( - LIBWEBSOCKETS DEFAULT_MSG LIBWEBSOCKETS_LIBRARIES LIBWEBSOCKETS_INCLUDE_DIRS) +set(lws_required "2.1.0") +if (LIBWEBSOCKETS_VERSION_STRING AND (LIBWEBSOCKETS_VERSION_STRING VERSION_LESS lws_required)) + message(STATUS "Found libwebsockets version ${LIBWEBSOCKETS_VERSION_STRING} but need at least ${lws_required}") +else() + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args( + LIBWEBSOCKETS DEFAULT_MSG LIBWEBSOCKETS_VERSION_STRING LIBWEBSOCKETS_LIBRARIES LIBWEBSOCKETS_INCLUDE_DIRS) +endif() if(NOT LIBWEBSOCKETS_FOUND) unset(LIBWEBSOCKETS_LIBRARIES) unset(LIBWEBSOCKETS_INCLUDE_DIRS) + unset(LIBWEBSOCKETS_VERSION_STRING) endif() http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/33feac55/src/http-none.c ---------------------------------------------------------------------- diff --git a/src/http-none.c b/src/http-none.c index 57869d5..df872bc 100644 --- a/src/http-none.c +++ b/src/http-none.c @@ -34,6 +34,8 @@ void qd_http_server_free(qd_http_server_t *h) {} void* qd_http_server_run(void* qd_http_server) { return 0; } +void qd_http_server_stop(qd_http_server_t *h) {} + qd_http_listener_t *qd_http_server_listen(qd_http_server_t *s, struct qd_listener_t *li) { return 0; } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
