# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial

[package]
name = "slint-cpp"
description = "Slint C++ integration"
authors.workspace = true
documentation.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true
build = "build.rs"
publish = false
# prefix used to convey path to generated includes to the C++ test driver
links = "slint_cpp"

[lib]
path = "lib.rs"
crate-type = ["lib", "cdylib", "staticlib"]

# Note, these features need to be kept in sync (along with their defaults) in
# the C++ crate's CMakeLists.txt
[features]
interpreter = ["slint-interpreter", "std"]
testing = ["i-slint-backend-testing"] # Enable some function used by the integration tests

backend-qt = ["i-slint-backend-selector/backend-qt", "std"]
backend-winit = ["i-slint-backend-selector/backend-winit", "std"]
backend-winit-x11 = ["i-slint-backend-selector/backend-winit-x11", "std"]
backend-winit-wayland = ["i-slint-backend-selector/backend-winit-wayland", "std"]
backend-linuxkms = ["i-slint-backend-selector/backend-linuxkms", "std"]
backend-linuxkms-noseat = ["i-slint-backend-selector/backend-linuxkms-noseat", "std"]
renderer-femtovg = ["i-slint-backend-selector/renderer-femtovg"]
renderer-skia = ["i-slint-backend-selector/renderer-skia", "i-slint-renderer-skia", "raw-window-handle"]
renderer-skia-opengl = ["i-slint-backend-selector/renderer-skia-opengl", "renderer-skia"]
renderer-skia-vulkan = ["i-slint-backend-selector/renderer-skia-vulkan", "renderer-skia"]
renderer-software = ["i-slint-backend-selector/renderer-software"]
gettext = ["i-slint-core/gettext-rs"]
accessibility = ["i-slint-backend-selector/accessibility"]

std = ["image", "i-slint-core/default", "i-slint-backend-selector"]
freestanding = ["i-slint-core/libm", "i-slint-core/unsafe-single-threaded"]
experimental = ["i-slint-core/software-renderer-rotation"]

default = ["std", "backend-winit", "renderer-femtovg", "backend-qt"]

[dependencies]
i-slint-backend-selector = { workspace = true, optional = true }
i-slint-backend-testing = { workspace = true, features = ["default"], optional = true }
i-slint-renderer-skia = {  workspace = true, features = ["default", "x11", "wayland"], optional = true }
i-slint-core = { workspace = true, features = ["ffi"] }
slint-interpreter = { workspace = true, features = ["ffi", "compat-1-2"], optional = true }
raw-window-handle = { version = "0.5", optional = true }
# Enable image-rs' default features to make all image formats to C++ users
image = { version = "0.24.0", optional = true }

esp-backtrace = { version = "0.11.0", features = ["panic-handler", "println"], optional = true }
esp-println = { version = "0.9.0", default-features = false, features = ["uart"], optional = true }

[build-dependencies]
anyhow = "1.0"
cbindgen = { workspace = true }
proc-macro2 = "1.0.11"
i-slint-common = { workspace = true, features = ["default"] }
