|
|
Donner
C++20 SVG rendering library
|
Donner is intended as a hobby project with the latest C++ spec, so it is likely that toolchains that support it won't be pre-installed.
CMake builds on Linux with the Skia backend: pkg-config and development libraries for Fontconfig and Freetype. For Debian/Ubuntu:
These are not required for the TinySkia backend (the default).
The recommended way to use Bazel is to install Bazelisk, which will automatically download Bazel as required. To install:
Verify that you can build with
All other dependencies will be downloaded on-demand.
The first build is slow since it downloads LLVM and other external dependencies (a few GB) and builds all dependencies from source. The Skia backend is significantly larger than TinySkia. After dependencies are downloaded, clean build times are:
Donner supports two rendering backends, selected at build time:
| Backend | Description | Default |
|---|---|---|
| tiny_skia | Lightweight software rasterizer. | Yes |
| skia | Full-featured 2D graphics via Google Skia, used as the reference renderer. | No |
Or use CMake presets:
Downstream projects including Donner via add_subdirectory() or FetchContent can override the default by setting DONNER_RENDERER_BACKEND before including Donner:
To run the tests, run:
To include experimental code as well, run:
See the latest Build Report.
To generate a build report locally:
To regenerate the checked-in build report at docs/build_report.md:
Bazel is the primary build system, but CMake support is also available through an experimental Bazel-to-CMake converter. This is for users who want to integrate Donner into their CMake-based projects.
To select the Skia backend instead:
See Renderer backend selection above for the full set of options and downstream override instructions.
To run tests, they must be enabled during the CMake configuration step:
This fetches the EnTT, googletest, rules_cc, and nlohmann_json dependencies via FetchContent and builds the libraries. Unit tests are not built by default and can be enabled by setting the DONNER_BUILD_TESTS CMake option to ON (e.g. cmake -DDONNER_BUILD_TESTS=ON ...).
That indicates that xcode is not installed, the bad error message is a known bazel issue: https://github.com/bazelbuild/bazel/issues/23111
Validate that xcode is installed with:
If it is not installed, install it from the App Store. Once this is complete clean bazel state and retry:
Donner builds everything from source, and particularly the skia dependency is large and slow to build. The first build is slow, but incremental builds are fast due to bazel's caching.
The Editor is an early prototype and hasn't made it to the tree. The Editor is built on the same foundation as the experimental svg_viewer in the tree. Run it with an opt build for the best experience: