[Libwebsockets] compile without client & test

"Andy Green (林安廸)" andy at warmcat.com
Sun Apr 28 04:43:25 CEST 2013


On 28/04/13 10:31, the mail apparently from allan George included:
> Hi,
>
> I need only static verson of libwebsocket, for my ARM target.
> lib/libwebsockets.a
>
>
> I do not need test  & dynamic version of libwebsocket
> *./configure --without-client --without-extensions --disable-debug
> --without-daemonize*
>
> There is no configure file in latest cmake base GIT code ? How can i
> achieve it in Cmake build ?

There are some examples in ./README.build, see the Cross Compiling section

cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr \
          -DCMAKE_TOOLCHAIN_FILE=../cross-arm-linux-gnueabihf.cmake \
          -DWITHOUT_EXTENSIONS=1 -DWITH_SSL=0

The other options you can control like that (pasted from CMakeLists.txt)

option(WITH_SSL "Include SSL support (default OpenSSL, CyaSSL if 
USE_CYASSL is set)" ON)
option(USE_EXTERNAL_ZLIB "Search the system for ZLib instead of using 
the included one (on Windows)" OFF)
option(USE_CYASSL "Use CyaSSL replacement for OpenSSL. When settings 
this, you also need to specify CYASSL_LIB and CYASSL_INCLUDE_DIRS" OFF)
option(WITHOUT_BUILTIN_GETIFADDRS "Don't use BSD getifaddrs 
implementation from libwebsockets if it is missing (this will result in 
a compilation error) ... Default is your libc provides it. On some 
systems such as uclibc it doesn't exist." OFF)
option(WITHOUT_CLIENT "Don't build the client part of the library" OFF)
option(WITHOUT_SERVER "Don't build the server part of the library" OFF)
#option(WITH_LIBCRYPTO "Use libcrypto MD5 and SHA1 implementations" ON)
option(LINK_TESTAPPS_DYNAMIC "Link the test apps to the shared version 
of the library. Default is to link statically" OFF)
option(WITHOUT_TESTAPPS "Don't build the libwebsocket-test-apps" OFF)
option(WITHOUT_TEST_SERVER "Don't build the test server" OFF)
option(WITHOUT_TEST_SERVER_EXTPOLL "Don't build the test server version 
that uses external poll" OFF)
option(WITHOUT_TEST_PING "Don't build the ping test application" OFF)
option(WITHOUT_TEST_CLIENT "Don't build the client test application" OFF)
option(WITHOUT_TEST_FRAGGLE "Don't build the ping test application" OFF)
option(WITHOUT_DEBUG "Don't compile debug related code" OFF)
option(WITHOUT_EXTENSIONS "Don't compile with extensions" OFF)
option(WITH_LATENCY "Build latency measuring code into the library

./cross-arm-linux-gnueabihf.cmake is also included in libwebsockets so 
you can adapt it to your toolchain.

-Andy




More information about the Libwebsockets mailing list