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

[package]
name = "i-slint-backend-selector"
description = "Helper crate to pick the default rendering backend for Slint"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true
build = "build.rs"

[lib]
path = "lib.rs"

[features]
backend-winit = ["backend-winit-x11", "backend-winit-wayland"]
backend-winit-x11 = ["i-slint-backend-winit/x11"]
backend-winit-wayland = ["i-slint-backend-winit/wayland"]
backend-linuxkms = ["i-slint-backend-linuxkms/libseat"]
backend-linuxkms-noseat = ["i-slint-backend-linuxkms"]
backend-qt = ["i-slint-backend-qt/enable"]
backend-testing = ["i-slint-backend-testing/internal"]

renderer-femtovg = [
  "dep:i-slint-renderer-femtovg",
  "i-slint-backend-winit?/renderer-femtovg",
  "i-slint-backend-linuxkms?/renderer-femtovg",
]
renderer-femtovg-wgpu = [
  "i-slint-renderer-femtovg/wgpu",
  "i-slint-backend-winit?/renderer-femtovg-wgpu",
  "i-slint-backend-linuxkms?/renderer-femtovg-wgpu",
]
renderer-skia = ["i-slint-backend-winit?/renderer-skia", "i-slint-backend-linuxkms?/renderer-skia"]
renderer-skia-opengl = [
  "i-slint-backend-winit?/renderer-skia-opengl",
  "i-slint-backend-linuxkms?/renderer-skia-opengl",
  "i-slint-renderer-skia/opengl",
]
renderer-skia-vulkan = [
  "i-slint-backend-winit?/renderer-skia-vulkan",
  "i-slint-backend-linuxkms?/renderer-skia-vulkan",
  "i-slint-renderer-skia/vulkan",
]
renderer-software = ["i-slint-backend-winit?/renderer-software", "i-slint-backend-linuxkms?/renderer-software"]

rtti = ["i-slint-core/rtti", "i-slint-backend-qt?/rtti"]
accessibility = ["i-slint-backend-winit?/accessibility"]

raw-window-handle-06 = ["i-slint-core/raw-window-handle-06", "i-slint-backend-winit?/raw-window-handle-06"]

system-testing = ["i-slint-backend-testing/system-testing"]
mcp = ["i-slint-backend-testing/mcp"]

unstable-wgpu-27 = [
  "i-slint-core/unstable-wgpu-27",
  "i-slint-renderer-skia?/unstable-wgpu-27",
  "i-slint-renderer-femtovg?/unstable-wgpu-27",
  "i-slint-backend-winit?/unstable-wgpu-27",
]

unstable-wgpu-28 = [
  "i-slint-core/unstable-wgpu-28",
  "i-slint-renderer-skia?/unstable-wgpu-28",
  "i-slint-renderer-femtovg?/unstable-wgpu-28",
  "i-slint-backend-winit?/unstable-wgpu-28",
  "i-slint-backend-linuxkms?/unstable-wgpu-28",
]

unstable-winit-030 = ["i-slint-backend-winit"]

unstable-libinput-09 = ["dep:input"]

backend-android-activity = ["dep:i-slint-backend-android-activity"]

default = ["backend-winit"]

[dependencies]
cfg-if = "1"
i-slint-core = { workspace = true }
i-slint-backend-testing = { workspace = true, optional = true }
i-slint-core-macros = { workspace = true }

[target.'cfg(not(target_os = "android"))'.dependencies]
i-slint-backend-winit = { workspace = true, features = ["default", "muda"], optional = true }
i-slint-renderer-skia = { workspace = true, optional = true }
i-slint-renderer-femtovg = { workspace = true, optional = true }

[target.'cfg(target_os = "android")'.dependencies]
i-slint-backend-android-activity = { workspace = true, optional = true }

[target.'cfg(not(target_os = "wasm"))'.dependencies]
i-slint-backend-qt = { workspace = true, optional = true }

[target.'cfg(target_os = "linux")'.dependencies]
i-slint-backend-linuxkms = { workspace = true, features = ["default"], optional = true }
input = { workspace = true, optional = true }

[build-dependencies]
i-slint-common = { workspace = true }

[dev-dependencies]
slint = { path = "../../../api/rs/slint", default-features = false, features = ["std", "compat-1-2", "backend-winit", "renderer-software", "unstable-winit-030"] }

[package.metadata.docs.rs]
features = ["renderer-software"]
rustdoc-args = ["--generate-link-to-definition"]
