Skip to content

Commit

Permalink
C++: Make it working to have experimental withoud std
Browse files Browse the repository at this point in the history
  • Loading branch information
ogoffart committed Jul 18, 2023
1 parent 7cffad2 commit 1805e6c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion api/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ define_cargo_dependent_feature(renderer-winit-software "Enable support for the s

define_cargo_dependent_feature(backend-qt "Enable Qt based rendering backend" ON SLINT_FEATURE_STD)

define_cargo_dependent_feature(experimental "Enable experimental features (no compatibility guarantees)" OFF SLINT_FEATURE_STD)
define_cargo_feature(experimental "Enable experimental features (no compatibility guarantees)" OFF)
define_cargo_dependent_feature(gettext "Enable support of translations using gettext" OFF SLINT_FEATURE_STD)
define_cargo_dependent_feature(accessibility "Enable integration with operating system provided accessibility APIs" ON SLINT_FEATURE_STD)

Expand Down Expand Up @@ -144,6 +144,10 @@ if (NOT SLINT_FEATURE_STD)
list(APPEND features i-slint-core/libm i-slint-core/unsafe-single-threaded)
endif()

if (SLINT_FEATURE_STD AND SLINT_FEATURE_EXPERIMENTAL)
list(APPEND features experimental-skia)
endif()

set_property(
TARGET slint-cpp
PROPERTY CORROSION_FEATURES
Expand Down
4 changes: 2 additions & 2 deletions api/cpp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ renderer-winit-software = ["i-slint-backend-selector/renderer-winit-software"]
gettext = ["i-slint-core/gettext-rs"]
accessibility = ["i-slint-backend-selector/accessibility"]

experimental = ["i-slint-renderer-skia", "raw-window-handle", "experimental-platform"]
experimental-platform = []
experimental = []
experimental-skia = ["i-slint-renderer-skia", "raw-window-handle", "experimental"]

std = ["image", "i-slint-core/default", "i-slint-backend-selector"]

Expand Down
2 changes: 1 addition & 1 deletion api/cpp/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn main() -> Result<(), anyhow::Error> {

let enabled_features = EnabledFeatures {
interpreter: std::env::var("CARGO_FEATURE_SLINT_INTERPRETER").is_ok(),
experimental: std::env::var("CARGO_FEATURE_SLINT_INTERPRETER").is_ok(),
experimental: std::env::var("CARGO_FEATURE_EXPERIMENTAL").is_ok(),
backend_qt: std::env::var("CARGO_FEATURE_BACKEND_QT").is_ok(),
std: std::env::var("CARGO_FEATURE_STD").is_ok(),
};
Expand Down
2 changes: 1 addition & 1 deletion api/cpp/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use alloc::rc::Rc;
use core::ffi::c_void;
use i_slint_core::window::{ffi::WindowAdapterRcOpaque, WindowAdapter};

#[cfg(feature = "experimental-platform")]
#[cfg(feature = "experimental")]
pub mod platform;

#[cfg(feature = "i-slint-backend-selector")]
Expand Down

0 comments on commit 1805e6c

Please sign in to comment.