Files
Jason Larabie 52b6c66fa1 Add C++ Bindings (#3544)
# Description of Changes

This adds C++ server bindings (/crate/bindings-cpp) to allow writing C++
20 modules.

- Emscripten WASM build system integration with CMake
- Macro-based code generation (SPACETIMEDB_TABLE, SPACETIMEDB_REDUCER,
etc)
- All SpacetimeDB types supported (primitives, Timestamp, Identity,
Uuid, etc)
- Product types via SPACETIMEDB_STRUCT
- Sum types via SPACETIMEDB_ENUM
- Constraints marked with FIELD* macros

# API and ABI breaking changes

None

# Expected complexity level and risk

2 - Doesn't heavily impact any other areas but is complex macro C++
structure to support a similar developer experience, did have a small
impact on init command

# Testing

- [x] modules/module-test-cpp - heavily tested every reducer
- [x] modules/benchmarks-cpp - tested through the standalone (~6x faster
than C#, ~6x slower than Rust)
- [x] modules/sdk-test-cpp
- [x] modules/sdk-test-procedure-cpp
- [x] modules/sdk-test-view-cpp  
- [x] Wrote several test modules myself
- [x] Quickstart smoketest [Currently in progress]
- [ ] Write Blackholio C++ server module

---------

Signed-off-by: Jason Larabie <jason@clockworklabs.io>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: Ryan <r.ekhoff@clockworklabs.io>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2026-02-07 04:26:45 +00:00

55 lines
1.6 KiB
C

/**
* @file version.h
* @brief SpacetimeDB C++ Bindings Version Information
*
* This file is auto-generated by CMake from version.h.in.
* Do not edit this file directly - it will be overwritten during the build.
* Version numbers are managed by the upgrade-version tool.
*/
#pragma once
namespace spacetimedb {
/**
* @brief Major version number
*
* Incremented for breaking API changes.
*/
constexpr int VERSION_MAJOR = @PROJECT_VERSION_MAJOR@;
/**
* @brief Minor version number
*
* Incremented for new features in a backwards-compatible manner.
*/
constexpr int VERSION_MINOR = @PROJECT_VERSION_MINOR@;
/**
* @brief Patch version number
*
* Incremented for backwards-compatible bug fixes.
*/
constexpr int VERSION_PATCH = @PROJECT_VERSION_PATCH@;
/**
* @brief Full version string
*
* Format: "MAJOR.MINOR.PATCH"
*/
constexpr const char* VERSION_STRING = "@PROJECT_VERSION@";
} // namespace spacetimedb
// C-style macros for preprocessor checks
#define SPACETIMEDB_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define SPACETIMEDB_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define SPACETIMEDB_VERSION_PATCH @PROJECT_VERSION_PATCH@
#define SPACETIMEDB_VERSION_STRING "@PROJECT_VERSION@"
// Convenience macro for version checking in preprocessor
#define SPACETIMEDB_VERSION_AT_LEAST(major, minor, patch) \
((SPACETIMEDB_VERSION_MAJOR > (major)) || \
(SPACETIMEDB_VERSION_MAJOR == (major) && SPACETIMEDB_VERSION_MINOR > (minor)) || \
(SPACETIMEDB_VERSION_MAJOR == (major) && SPACETIMEDB_VERSION_MINOR == (minor) && SPACETIMEDB_VERSION_PATCH >= (patch)))