Make it possible to opt out of the default rendering backend selection

The default backend does not select any features or backends by default
on the Cargo.toml feature level. And with this change it also doesn't do
that anymore based on the target platform.

That means if the rust api crate is built with default-features = false,
no backend will be selected and the user has to take care of backend
initialization through other means.

The feature defaults, generally, are in the rust API crate, the
interpreter crate and C++ CMakeLists.txt. The latter triggers a cargo
build of sixtyfps-cpp with --no-default-features. However the cpp_test
job in the CI doesn't build sixtyfps-cpp with CMake but instead calls
cargo directly. Therefore the defaults are now also coded in the
sixtyfps-cpp Cargo.toml, to ensure that *a* rendering backend is chosen
(since the cfg.target bit is gone).
This commit is contained in:
Simon Hausmann 2021-11-11 11:08:05 +01:00 committed by Olivier Goffart
parent 231d46bd69
commit 8f940a446e
3 changed files with 45 additions and 41 deletions

View file

@ -26,6 +26,7 @@ backend-gl = ["sixtyfps-rendering-backend-default/sixtyfps-rendering-backend-gl"
backend-qt = ["sixtyfps-rendering-backend-default/sixtyfps-rendering-backend-qt"]
# Enable some function used by the integration tests
testing = ["sixtyfps-rendering-backend-testing"]
default = ["backend-gl", "x11", "backend-qt"]
[dependencies]
sixtyfps-corelib = { version = "=0.1.5", path="../../sixtyfps_runtime/corelib", features = ["ffi"] }