doc: document BUILD_SHARED_LIBS

This commit is contained in:
Benjamin Sergeant 2021-03-20 09:50:21 -07:00
parent 88970604e3
commit d706a4a73e
7 changed files with 18 additions and 14 deletions

View File

@ -14,7 +14,7 @@ jobs:
- run: |
mkdir build
cd build
cmake -GNinja -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_C_COMPILER=cl.exe -DUSE_WS=1 -DUSE_TEST=1 -DUSE_ZLIB=0 ..
cmake -GNinja -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_C_COMPILER=cl.exe -DUSE_WS=1 -DUSE_TEST=1 -DUSE_ZLIB=OFF -DBUILD_SHARED_LIBS=ON ..
- run: |
cd build
ninja

View File

@ -111,6 +111,7 @@ set( IXWEBSOCKET_HEADERS
ixwebsocket/IXWebSocketVersion.h
)
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF)
option(USE_TLS "Enable TLS support" FALSE)
if (USE_TLS)
@ -144,7 +145,7 @@ if (USE_TLS)
endif()
endif()
add_library( ixwebsocket STATIC
add_library( ixwebsocket
${IXWEBSOCKET_SOURCES}
${IXWEBSOCKET_HEADERS}
)

View File

@ -2,6 +2,10 @@
All changes to this project will be documented in this file.
## [11.1.1] - 2021-03-20
(cmake) Library can be built as a static or a dynamic library, controlled with BUILD_SHARED_LIBS. Default to static library
## [11.1.0] - 2021-03-16
(ixwebsocket) Use LEAN_AND_MEAN Windows define to help with undefined link error when building a DLL. Support websocket server disablePerMessageDeflate option correctly.

View File

@ -17,13 +17,13 @@ There is a unittest which can be executed by typing `make test`.
Options for building:
* `-DBUILD_SHARED_LIBS=ON` will build the unittest as a shared libary instead of a static library, which is the default
* `-DUSE_ZLIB=1` will enable zlib support, required for http client + server + websocket per message deflate extension
* `-DUSE_TLS=1` will enable TLS support
* `-DUSE_OPEN_SSL=1` will use [openssl](https://www.openssl.org/) for the TLS support (default on Linux and Windows)
* `-DUSE_MBED_TLS=1` will use [mbedlts](https://tls.mbed.org/) for the TLS support
* `-DUSE_WS=1` will build the ws interactive command line tool
* `-DUSE_TEST=1` will build the unittest
* `-DUSE_PYTHON=1` will use Python3 for cobra bots, require Python3 to be installed.
If you are on Windows, look at the [appveyor](https://github.com/machinezone/IXWebSocket/blob/master/appveyor.yml) file (not maintained much though) or rather the [github actions](https://github.com/machinezone/IXWebSocket/blob/master/.github/workflows/unittest_windows.yml) which have instructions for building dependencies.

View File

@ -6,4 +6,4 @@
#pragma once
#define IX_WEBSOCKET_VERSION "11.1.0"
#define IX_WEBSOCKET_VERSION "11.1.1"

View File

@ -140,9 +140,8 @@ namespace ix
file.seekg(0, file.beg);
memblock.reserve((size_t) size);
memblock.insert(memblock.begin(),
std::istream_iterator<char>(file),
std::istream_iterator<char>());
memblock.insert(
memblock.begin(), std::istream_iterator<char>(file), std::istream_iterator<char>());
return memblock;
}

View File

@ -64,9 +64,8 @@ namespace
file.seekg(0, file.beg);
memblock.reserve((size_t) size);
memblock.insert(memblock.begin(),
std::istream_iterator<char>(file),
std::istream_iterator<char>());
memblock.insert(
memblock.begin(), std::istream_iterator<char>(file), std::istream_iterator<char>());
return std::make_pair(true, memblock);
}
@ -89,9 +88,8 @@ namespace
file.seekg(0, file.beg);
memblock.reserve((size_t) size);
memblock.insert(memblock.begin(),
std::istream_iterator<char>(file),
std::istream_iterator<char>());
memblock.insert(
memblock.begin(), std::istream_iterator<char>(file), std::istream_iterator<char>());
std::string bytes(memblock.begin(), memblock.end());
return bytes;
@ -1429,7 +1427,9 @@ namespace ix
if (filename.empty())
{
spdlog::error("Cannot save content to disk: No output file supplied, and not filename could be extracted from the url {}", url);
spdlog::error("Cannot save content to disk: No output file supplied, and not "
"filename could be extracted from the url {}",
url);
}
else
{