beman.gates is (... TODO: description).
Implements: std::todo proposed in TODO (P4215R0).
Status: Under development and not yet ready for production use.
beman.gates is licensed under the Apache License v2.0 with LLVM Exceptions.
TODO
Full runnable examples can be found in examples/.
This project requires at least the following to build:
- A C++ compiler that conforms to the C++20 standard or greater
- CMake 3.30 or later
- (Test Only) GoogleTest
You can disable building tests by setting CMake option BEMAN_GATES_BUILD_TESTS to
OFF when configuring the project.
| Compiler | Version | C++ Standards | Standard Library |
|---|---|---|---|
| GCC | 16-14 | C++26, C++23 | libstdc++ |
| Clang | 23-19 | C++26, C++23 | libstdc++, libc++ |
| Clang | 18 | C++26, C++23 | libc++ |
| Clang | 18 | C++23 | libstdc++ |
| AppleClang | latest | C++26, C++23 | libc++ |
| MSVC | latest | C++23 | MSVC STL |
Set the CMake option BEMAN_GATES_ENABLE_TRACY=ON to enable Tracy support.
It is disabled by default; disabled builds do not fetch, include, or link Tracy.
Callers can include <beman/gates/config.hpp> and use
BEMAN_GATES_ENABLE_PROFILING() to conditionally compile profiling-specific state
or supporting code without depending on the selected backend. This macro is
derived from BEMAN_GATES_ENABLE_TRACY; it is not a separate CMake option.
It is 0 when profiling is disabled, including when no generated configuration
header is available. Module consumers must include the configuration header
explicitly because importing a module does not expose macros.
When enabled, gates reuses an existing Tracy::TracyClient target or searches for
an installed Tracy CMake package. Otherwise, it fetches Tracy v0.13.1 at a pinned
commit. Linking to beman::gates propagates Tracy's include directories, compile
definitions (including TRACY_ENABLE), and client library to your application.
Use the matching Tracy profiler version to capture traces.
Installing a Tracy-enabled build records Tracy as a package dependency. Consumers
of that installation must also have the Tracy client package available.
See the Contributing Guidelines.
You can build gates using a CMake workflow preset:
cmake --workflow --preset gcc-releaseTo list available workflow presets, you can invoke:
cmake --list-presets=workflowFor details on building beman.gates without using a CMake preset, refer to the Contributing Guidelines.
The preferred way to install gates is via vcpkg. To do so, after installing vcpkg
itself, you need to add support for the Beman project's vcpkg
registry by configuring a
vcpkg-configuration.json file (which gates provides).
Then, simply run vcpkg install beman-gates.
To install beman.gates globally after building with the gcc-release preset, you can
run:
sudo cmake --install build/gcc-releaseAlternatively, to install to a prefix, for example /opt/beman, you can run:
sudo cmake --install build/gcc-release --prefix /opt/bemanThis will generate the following directory structure:
/opt/beman
├── include
│ └── beman
│ └── gates
│ ├── gates.hpp
│ └── ...
└── lib
└── cmake
└── beman.gates
├── beman.gates-config-version.cmake
├── beman.gates-config.cmake
└── beman.gates-targets.cmakeIf you installed beman.gates to a prefix, you can specify that prefix to your CMake
project using CMAKE_PREFIX_PATH; for example, -DCMAKE_PREFIX_PATH=/opt/beman.
You need to bring in the beman.gates package to define the beman::gates CMake
target:
find_package(beman.gates REQUIRED)You will then need to add beman::gates to the link libraries of any libraries or
executables that include beman.gates headers.
target_link_libraries(yourlib PUBLIC beman::gates)To use beman.gates in your C++ project,
include an appropriate beman.gates header from your source code.
#include <beman/gates/gates.hpp>