doc: document BUILD_SHARED_LIBS
This commit is contained in:
		
							
								
								
									
										2
									
								
								.github/workflows/unittest_windows.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/unittest_windows.yml
									
									
									
									
										vendored
									
									
								
							@@ -14,7 +14,7 @@ jobs:
 | 
				
			|||||||
    - run: |
 | 
					    - run: |
 | 
				
			||||||
        mkdir build
 | 
					        mkdir build
 | 
				
			||||||
        cd 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: |
 | 
					    - run: |
 | 
				
			||||||
        cd build
 | 
					        cd build
 | 
				
			||||||
        ninja
 | 
					        ninja
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -111,6 +111,7 @@ set( IXWEBSOCKET_HEADERS
 | 
				
			|||||||
    ixwebsocket/IXWebSocketVersion.h
 | 
					    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)
 | 
					option(USE_TLS "Enable TLS support" FALSE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (USE_TLS)
 | 
					if (USE_TLS)
 | 
				
			||||||
@@ -144,7 +145,7 @@ if (USE_TLS)
 | 
				
			|||||||
    endif()
 | 
					    endif()
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_library( ixwebsocket STATIC
 | 
					add_library( ixwebsocket
 | 
				
			||||||
    ${IXWEBSOCKET_SOURCES}
 | 
					    ${IXWEBSOCKET_SOURCES}
 | 
				
			||||||
    ${IXWEBSOCKET_HEADERS}
 | 
					    ${IXWEBSOCKET_HEADERS}
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
All changes to this project will be documented in this file.
 | 
					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
 | 
					## [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.
 | 
					(ixwebsocket) Use LEAN_AND_MEAN Windows define to help with undefined link error when building a DLL. Support websocket server disablePerMessageDeflate option correctly.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,13 +17,13 @@ There is a unittest which can be executed by typing `make test`.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Options for building:
 | 
					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_ZLIB=1` will enable zlib support, required for http client + server + websocket per message deflate extension
 | 
				
			||||||
* `-DUSE_TLS=1` will enable TLS support
 | 
					* `-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_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_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_WS=1` will build the ws interactive command line tool
 | 
				
			||||||
* `-DUSE_TEST=1` will build the unittest
 | 
					* `-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.
 | 
					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.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,4 +6,4 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IX_WEBSOCKET_VERSION "11.1.0"
 | 
					#define IX_WEBSOCKET_VERSION "11.1.1"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -140,9 +140,8 @@ namespace ix
 | 
				
			|||||||
        file.seekg(0, file.beg);
 | 
					        file.seekg(0, file.beg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        memblock.reserve((size_t) size);
 | 
					        memblock.reserve((size_t) size);
 | 
				
			||||||
        memblock.insert(memblock.begin(),
 | 
					        memblock.insert(
 | 
				
			||||||
                        std::istream_iterator<char>(file),
 | 
					            memblock.begin(), std::istream_iterator<char>(file), std::istream_iterator<char>());
 | 
				
			||||||
                        std::istream_iterator<char>());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return memblock;
 | 
					        return memblock;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										14
									
								
								ws/ws.cpp
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								ws/ws.cpp
									
									
									
									
									
								
							@@ -64,9 +64,8 @@ namespace
 | 
				
			|||||||
        file.seekg(0, file.beg);
 | 
					        file.seekg(0, file.beg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        memblock.reserve((size_t) size);
 | 
					        memblock.reserve((size_t) size);
 | 
				
			||||||
        memblock.insert(memblock.begin(),
 | 
					        memblock.insert(
 | 
				
			||||||
                        std::istream_iterator<char>(file),
 | 
					            memblock.begin(), std::istream_iterator<char>(file), std::istream_iterator<char>());
 | 
				
			||||||
                        std::istream_iterator<char>());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return std::make_pair(true, memblock);
 | 
					        return std::make_pair(true, memblock);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -89,9 +88,8 @@ namespace
 | 
				
			|||||||
        file.seekg(0, file.beg);
 | 
					        file.seekg(0, file.beg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        memblock.reserve((size_t) size);
 | 
					        memblock.reserve((size_t) size);
 | 
				
			||||||
        memblock.insert(memblock.begin(),
 | 
					        memblock.insert(
 | 
				
			||||||
                        std::istream_iterator<char>(file),
 | 
					            memblock.begin(), std::istream_iterator<char>(file), std::istream_iterator<char>());
 | 
				
			||||||
                        std::istream_iterator<char>());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        std::string bytes(memblock.begin(), memblock.end());
 | 
					        std::string bytes(memblock.begin(), memblock.end());
 | 
				
			||||||
        return bytes;
 | 
					        return bytes;
 | 
				
			||||||
@@ -1429,7 +1427,9 @@ namespace ix
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                if (filename.empty())
 | 
					                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
 | 
					                else
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user