Add application feature, which allows to build freestanding wgpu app

This commit is contained in:
aentity 2022-01-15 00:06:36 -08:00 committed by Héctor Ramón Jiménez
parent 3c2a8b70ad
commit 78c9d5bedf
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
4 changed files with 10 additions and 1 deletions

View file

@ -13,7 +13,9 @@ categories = ["gui"]
resolver = "2" resolver = "2"
[features] [features]
default = ["wgpu"] default = ["wgpu", "application"]
# Enables the building the application modules
application = ["iced_winit/application"]
# Enables the `Image` widget # Enables the `Image` widget
image = ["iced_wgpu/image", "image_rs"] image = ["iced_wgpu/image", "image_rs"]
# Enables the `Svg` widget # Enables the `Svg` widget

View file

@ -167,8 +167,10 @@
mod element; mod element;
mod error; mod error;
mod result; mod result;
#[cfg(feature = "application")]
mod sandbox; mod sandbox;
#[cfg(feature = "application")]
pub mod application; pub mod application;
pub mod clipboard; pub mod clipboard;
pub mod executor; pub mod executor;
@ -196,6 +198,7 @@ pub use iced_native::theme;
pub use runtime::event; pub use runtime::event;
pub use runtime::subscription; pub use runtime::subscription;
#[cfg(feature = "application")]
pub use application::Application; pub use application::Application;
pub use element::Element; pub use element::Element;
pub use error::Error; pub use error::Error;
@ -203,6 +206,7 @@ pub use event::Event;
pub use executor::Executor; pub use executor::Executor;
pub use renderer::Renderer; pub use renderer::Renderer;
pub use result::Result; pub use result::Result;
#[cfg(feature = "application")]
pub use sandbox::Sandbox; pub use sandbox::Sandbox;
pub use settings::Settings; pub use settings::Settings;
pub use subscription::Subscription; pub use subscription::Subscription;

View file

@ -13,6 +13,7 @@ categories = ["gui"]
[features] [features]
debug = ["iced_native/debug"] debug = ["iced_native/debug"]
system = ["sysinfo"] system = ["sysinfo"]
application = []
[dependencies] [dependencies]
window_clipboard = "0.2" window_clipboard = "0.2"

View file

@ -35,6 +35,7 @@
pub use iced_native::*; pub use iced_native::*;
pub use winit; pub use winit;
#[cfg(feature = "application")]
pub mod application; pub mod application;
pub mod clipboard; pub mod clipboard;
pub mod conversion; pub mod conversion;
@ -48,6 +49,7 @@ mod error;
mod position; mod position;
mod proxy; mod proxy;
#[cfg(feature = "application")]
pub use application::Application; pub use application::Application;
pub use clipboard::Clipboard; pub use clipboard::Clipboard;
pub use error::Error; pub use error::Error;