|
runtime 1.0.0
Checked CEL programs, owned values, and reusable execution stacks
|
Note: This project is a temporary solution for using the CEL language from cel-rs in C++. This library will be deprecated when using the Rust implementations from C++ becomes viable.
This tutorial builds cel-runtime from source as a static library inside your application's CMake build. No installation or package prefix is needed.
Use CMake 3.24 or later, Ninja, Git, and a C++20 compiler. The first configuration downloads the pinned sources and build infrastructure. You need Git read access to the dependency repositories. The runtime requires an IEEE binary64 double; its headers check the representation. The shell commands below use a POSIX shell.
Create an application directory:
Create a directory for the CPM bootstrap:
Save this bootstrap as cmake/CPM.cmake:
CMake downloads and verifies CPM before executing it. A checksum mismatch stops configuration. Keep the version and checksum together when updating.
Create main.cpp in your application directory:
Create CMakeLists.txt beside it:
Configure, build, and run the test from your application directory:
Confirm that client passes. CPM fetches the pinned runtime source and builds it as a static library by default. Dependency builds omit the runtime's tests and package installation rules. CPM_USE_LOCAL_PACKAGES OFF keeps CPM from preferring an installed package.
The cel::runtime target supplies the headers, static library, and C++20 requirement. Do not add dependency include or library directories manually. Select a reviewed release after @ when updating the dependency.
Continue with Compile and reuse a program to pass arguments, reserve stack storage, and evaluate the same program more than once.