Skip to content

Install & build (C++)

CMake 3.24 or newer, and a compiler with C++20 coroutines. Everything else the SDK needs it fetches itself.

include(FetchContent)
FetchContent_Declare(
tesseron
GIT_REPOSITORY https://github.com/Eigenwise/tesseron-cpp.git
GIT_TAG v0.1.0)
FetchContent_MakeAvailable(tesseron)
target_link_libraries(your_app PRIVATE tesseron::tesseron)

The CMake project is at the repository root. Pin GIT_TAG to a reviewed commit hash for a reproducible build.

DependencyVisibilityWhy
Boost.Asio (>= 1.85)publichandlers return boost::asio::awaitable<...>
nlohmann/jsonpublictesseron::Json is nlohmann::json
Boost.Beastprivatethe WebSocket listener
Catch2 v3tests onlyfetched only when TESSERON_BUILD_TESTS=ON

Every one arrives through FetchContent at a pinned version and a pinned SHA-256. No vcpkg, no Conan, no system packages: a clean checkout builds with nothing but a compiler, CMake, and a network connection.

BOOST_INCLUDE_LIBRARIES is limited to asio and beast, so this is not a full Boost build. The first configure still compiles Boost.Context, Boost.Container and Boost.Date_Time from source, which takes a couple of minutes; everything after that is incremental.

If your project already has its own Boost, declare it before FetchContent_MakeAvailable(tesseron) and the SDK will use yours.

OptionDefaultWhat it does
TESSERON_BUILD_TESTSOFFbuilds the Catch2 suite and registers it with CTest
TESSERON_BUILD_CONFORMANCE_HOSTOFFbuilds the fixture adapter the conformance runner drives
TESSERON_BUILD_EXAMPLESOFFbuilds the canonical headless todo and prompts examples
TESSERON_INSTALLon when top-levelgenerates install and export rules

Run these commands from the tesseron-cpp repository root.

Terminal window
cmake -S . -B build -G Ninja -DTESSERON_BUILD_TESTS=ON
cmake --build build
ctest --test-dir build --output-on-failure

CI builds ubuntu-latest with clang and windows-latest with MSVC (through ilammy/msvc-dev-cmd), both on Ninja, and runs the full conformance suite on each. Local development of this SDK was done on Windows 11 with clang 22.1.0 targeting x86_64-pc-windows-msvc, CMake 4.2.1 and Ninja 1.13.2.

Three compiler settings are attached to the library target rather than left to you, because they have to hold in every consumer too:

  • _WIN32_WINNT=0x0A00 on Windows. Asio reads it to pick its I/O completion API, and it has to be defined before any Asio header is included, in your translation units as well as the SDK's.
  • /bigobj on MSVC. Beast's templates blow past the default object-section limit.
  • /Zc:__cplusplus on MSVC. Without it the compiler reports C++98 in __cplusplus, and header feature checks quietly fall back to pre-C++20 paths.
Terminal window
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/your/prefix
cmake --build build --target install

That writes a tesseron-config.cmake, so a consumer can find_package(tesseron) instead of fetching sources. An installed tesseron does not carry Boost or nlohmann/json with it: the config file resolves those through find_dependency, the way it would for any other shared dependency. The conformance host is deliberately neither installed nor exported.