Skip to content

Latest commit

 

History

History
81 lines (60 loc) · 4.94 KB

File metadata and controls

81 lines (60 loc) · 4.94 KB

Windows MSVC Windows ClangCL Linux GCC Linux Clang MacOS AppleClang Clang Tidy

blazeauth-cpp-websocket-sdk

C++ client library for blazeauth websocket API.

This project compiles the SDK necessary to connect blazeauth to your project. For manual integration, you typically link the blazeauth_websocket and wolfssl static libraries and also add any required platform/system libraries for your target environment (for example pthreads on Linux or CoreFoundation/Security on macOS), after which you can use api.hpp in your project.

The external API (api.hpp) requires C++17 or newer, while the library project itself requires the C++23 standard for compilation.

Requirements

Install these tools before building:

  1. git (for clone + submodules)
  2. cmake 3.21 or newer
  3. A C/C++ toolchain with C++23 support
  4. A build tool (Ninja, Unix Makefiles, or Visual Studio/MSBuild generator)
  5. Internet access during first configure/build (to fetch bundled third-party dependencies if not already installed)

Tested compiler configurations

  • Windows: Visual Studio 2022 (MSVC v143) or newer
  • Linux: GCC 15.2+ or Clang 20+
  • macOS: recent Apple Clang with solid C++23 support

Platform quick-start

The commands below build the project as static libraries.

Note

After successfully completing the final copy step, the manually assembled SDK folder should be located in {current_directory}/build/blazeauth-sdk

Windows (Visual Studio 2022)

git clone --recurse-submodules --shallow-submodules https://github.com/blazeauth/blazeauth-cpp-websocket-sdk.git
cd blazeauth-cpp-websocket-sdk
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DBLAZEAUTH_BUILD_WEBSOCKET_API_EXAMPLES=OFF -DCMAKE_CXX_FLAGS="/Zc:inline"
cmake --build build --config Release
cmake -E make_directory build/blazeauth-sdk && cmake -E copy_if_different build/Release/blazeauth_websocket.lib build/Release/wolfssl.lib include/blazeauth/api/api.hpp build/blazeauth-sdk
start explorer.exe build\blazeauth-sdk

Important

If you have Visual Studio 2026 installed instead of Visual Studio 2022, replace the step cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DBLAZEAUTH_BUILD_WEBSOCKET_API_EXAMPLES=OFF -DCMAKE_CXX_FLAGS="/Zc:inline" with

cmake -S . -B build -G "Visual Studio 18 2026" -A x64 -DBLAZEAUTH_BUILD_WEBSOCKET_API_EXAMPLES=OFF -DCMAKE_CXX_FLAGS="/Zc:inline"

Linux/macOS (Ninja)

git clone --recurse-submodules --shallow-submodules https://github.com/blazeauth/blazeauth-cpp-websocket-sdk.git
cd blazeauth-cpp-websocket-sdk
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBLAZEAUTH_BUILD_WEBSOCKET_API_EXAMPLES=OFF
cmake --build build -j
mkdir -p build/blazeauth-sdk && cp "$(find build -name 'libblazeauth_websocket.a' -print -quit)" "$(find build -name 'libwolfssl.a' -print -quit)" include/blazeauth/api/api.hpp build/blazeauth-sdk

Important

The copied blazeauth-sdk folder is only a small manually assembled bundle of the main archives/header. When linking it into your own project without reusing this CMake build, you may also need to add platform/system libraries required by the selected toolchain and TLS backend, such as pthreads on Linux or CoreFoundation/Security on macOS.

ABI Note

This project exposes a C++ API and links C++ standard library types in public headers (for example std::string, std::vector, std::function), so ABI depends on compiler + standard library + compile flags.

To avoid ABI issues:

  1. Build your app and this library with the same compiler family (and preferably the same version).
  2. Use consistent runtime settings (especially on MSVC: /MD vs /MT).
  3. Keep dependencies/toolchain consistent across all linked binaries.
  4. Rebuild the library when switching compiler, STL implementation, architecture, or major flags.