Commit 173e9c4e made LWS_SEND_BUFFER_SIZE a multiple of a certain
value returned by _LWS_PAD_SIZE macro. This macro expanded to
"sizeof(void *)" on non-x86_64 architectures, which made it
unsuitable to use LWS_SEND_BUFFER_SIZE in preprocessor #if
expressions in the library user code.
This patch preserves the padding logic since commit 173e9c4e but
makes it more preprocessor-friendly for applications using
libwebsockets by setting _LWS_PAD_SIZE to the size of "void *"
determined by cmake when libwebsockets is configured for the
target platform.
Signed-off-by: Alexander Lukichev <alexander.lukichev@gmail.com>
Since we include lws_config.h in the public headers, at least our HAVE_ macros should be kind of unique, so that we don't get redefinitions when used with other libraries using config files as well.
This patch lets libwebsockets use the lastest version of wolfSSL (the new name for CyaSSL).
The reason for the patch is that allthough wolfSSL provides compatibility headers for (old) projects using CyaSSL,
these are incomplete and do not work for libwebsockets.
The patch also fixes a typo in CMakeLists.txt where CYASSL_LIBRARIES was added to include_directories() instead of CYASSL_INCLUDE_DIRS.
Signed-off-by: ABruines <alexander.bruines@gmail.com>
* Default CMAKE_BUILD_TYPE to Release
* Use CMAKE_BUILD_TYPE to define _DEBUG (NDEBUG is more standard though,
but cmake defines it)
* Drop LWS_WITHOUT_DEBUG (use CMAKE_BUILD_TYPE for that)
* Drop LWS_NO_EXTERNAL_POLL (was not used)
* Drop CMAKE_BUILD (CMake is the only build system now)
* Add LWS_WITH_STATIC and LWS_WITH_SHARED to choose what version(s) to
build
* Add LWS_XXX_LIBRARIES and LWS_XXX_INCLUDE_DIRS for each library
dependency (zlib, openssl, libev, cyassl)
* Support setting of XXX_LIBRARIES, XXX_LIBRARIES and XXX_INCLUDE_DIRS
by parent project (when included with add_subdirectory())
* Rename LWS_USE_EXTERNAL_ZLIB to LWS_USE_BUNDLED_ZLIB and default it to
NO (since it's Windows only)
* Default LWS_WITHOUT_DAEMONIZE to NO (since network lib shouldn't know
how to do it anyway)
* Rename config.h.cmake to lws_config.h.in
* Rename shared library to websockets_shared so linker will not be
confused
* Fix inline keyword detection in clang
* Explicitly set MACOSX_RPATH to YES on MacOS
By default, CMake sets C and C++ as languages used by the project.
This makes the configuration failed if no C++ compiler is found.
Since libwesockets in written in pure C, no C++, there is no reason to
disable it when the toolchain has no C++ support.
This patch just make the CMake code reflecting the real status of the
project with regard to the languages used.
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
The lws_config.h is generated based on configuration
options for the build process. In order to write
applications which compile code depending of the
presence of a feature (like the test-server does)
this header file needs to be installed.
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
When creating the directory where to put the files needed by the test-server CMake would fail because it tried to create the directory /../share/libwebsockets-test-server, which is not possible. This happens since the TARGET_FILE_DIR for the test-server is not fetched properly.
Also mentioned in this trac ticket:
http://libwebsockets.org/trac/libwebsockets/ticket/84
This adds npn / alpn support if your openssl can handle it.
Then, browsers that understand alpn will by default
negotiate http/1.1 and work as normal.
Clients that understand http2.0 can negotiate h2-14 and
use the basic but working http2.0 support automatically
Signed-off-by: Andy Green <andy.green@linaro.org>
merged by andy@warmcat.com via https://github.com/gaby64/libwebsockets-libev
To use, you need to both
- cmake ---> -DLWS_USE_LIBEV=1
- info->options must have LWS_SERVER_OPTION_LIBEV set when creating the context
this is so a single library can be built for distros to support apps that use
normal polling and apps that use libev polling.