From 78c9d5bedfdee566c4cb4371e17b48901bab99ae Mon Sep 17 00:00:00 2001 From: aentity Date: Sat, 15 Jan 2022 00:06:36 -0800 Subject: Add application feature, which allows to build freestanding wgpu app --- Cargo.toml | 4 +++- src/lib.rs | 4 ++++ winit/Cargo.toml | 1 + winit/src/lib.rs | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index cffa5409..9196d810 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,9 @@ categories = ["gui"] resolver = "2" [features] -default = ["wgpu"] +default = ["wgpu", "application"] +# Enables the building the application modules +application = ["iced_winit/application"] # Enables the `Image` widget image = ["iced_wgpu/image", "image_rs"] # Enables the `Svg` widget diff --git a/src/lib.rs b/src/lib.rs index 8209952f..3df7183e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -167,8 +167,10 @@ mod element; mod error; mod result; +#[cfg(feature = "application")] mod sandbox; +#[cfg(feature = "application")] pub mod application; pub mod clipboard; pub mod executor; @@ -196,6 +198,7 @@ pub use iced_native::theme; pub use runtime::event; pub use runtime::subscription; +#[cfg(feature = "application")] pub use application::Application; pub use element::Element; pub use error::Error; @@ -203,6 +206,7 @@ pub use event::Event; pub use executor::Executor; pub use renderer::Renderer; pub use result::Result; +#[cfg(feature = "application")] pub use sandbox::Sandbox; pub use settings::Settings; pub use subscription::Subscription; diff --git a/winit/Cargo.toml b/winit/Cargo.toml index f66b92fa..d3ed949f 100644 --- a/winit/Cargo.toml +++ b/winit/Cargo.toml @@ -13,6 +13,7 @@ categories = ["gui"] [features] debug = ["iced_native/debug"] system = ["sysinfo"] +application = [] [dependencies] window_clipboard = "0.2" diff --git a/winit/src/lib.rs b/winit/src/lib.rs index e32cc9af..edba887b 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -35,6 +35,7 @@ pub use iced_native::*; pub use winit; +#[cfg(feature = "application")] pub mod application; pub mod clipboard; pub mod conversion; @@ -48,6 +49,7 @@ mod error; mod position; mod proxy; +#[cfg(feature = "application")] pub use application::Application; pub use clipboard::Clipboard; pub use error::Error; -- cgit From 98b5832917fa709bd9977e776d629e2b0177d935 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 26 Sep 2022 15:58:12 +0200 Subject: Remove `application` feature from `iced` crate --- Cargo.toml | 6 ++---- src/lib.rs | 4 ---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9196d810..725baecc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,9 +13,7 @@ categories = ["gui"] resolver = "2" [features] -default = ["wgpu", "application"] -# Enables the building the application modules -application = ["iced_winit/application"] +default = ["wgpu"] # Enables the `Image` widget image = ["iced_wgpu/image", "image_rs"] # Enables the `Svg` widget @@ -98,7 +96,7 @@ iced_core = { version = "0.5", path = "core" } iced_futures = { version = "0.4", path = "futures" } iced_native = { version = "0.5", path = "native" } iced_graphics = { version = "0.3", path = "graphics" } -iced_winit = { version = "0.4", path = "winit" } +iced_winit = { version = "0.4", path = "winit", features = ["application"] } iced_glutin = { version = "0.3", path = "glutin", optional = true } iced_glow = { version = "0.3", path = "glow", optional = true } thiserror = "1.0" diff --git a/src/lib.rs b/src/lib.rs index 3df7183e..8209952f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -167,10 +167,8 @@ mod element; mod error; mod result; -#[cfg(feature = "application")] mod sandbox; -#[cfg(feature = "application")] pub mod application; pub mod clipboard; pub mod executor; @@ -198,7 +196,6 @@ pub use iced_native::theme; pub use runtime::event; pub use runtime::subscription; -#[cfg(feature = "application")] pub use application::Application; pub use element::Element; pub use error::Error; @@ -206,7 +203,6 @@ pub use event::Event; pub use executor::Executor; pub use renderer::Renderer; pub use result::Result; -#[cfg(feature = "application")] pub use sandbox::Sandbox; pub use settings::Settings; pub use subscription::Subscription; -- cgit