Skip to content

Commit

Permalink
Add application feature, which allows to build freestanding wgpu app
Browse files Browse the repository at this point in the history
  • Loading branch information
aentity committed Feb 22, 2022
1 parent adce9e0 commit 076a523
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ categories = ["gui"]
resolver = "2"

[features]
default = ["wgpu"]
default = ["wgpu", "application"]
application = ["iced_winit/application"]
# Enables the `iced_wgpu` renderer
wgpu = ["iced_wgpu"]
# Enables the `Image` widget
Expand Down
2 changes: 1 addition & 1 deletion native/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@ pub use renderer::Renderer;
pub use runtime::Runtime;
pub use shell::Shell;
pub use subscription::Subscription;
pub use user_interface::UserInterface;
pub use user_interface::{Cache, UserInterface};
pub use widget::Widget;
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,13 @@
#![forbid(unsafe_code)]
#![forbid(rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg))]

#[cfg(feature = "application")]
mod application;
mod element;
mod error;
mod result;
#[cfg(feature = "application")]
mod sandbox;

pub mod clipboard;
Expand All @@ -210,11 +213,13 @@ use iced_glow as renderer;
#[doc(no_inline)]
pub use widget::*;

#[cfg(feature = "application")]
pub use application::Application;
pub use element::Element;
pub use error::Error;
pub use executor::Executor;
pub use result::Result;
#[cfg(feature = "application")]
pub use sandbox::Sandbox;
pub use settings::Settings;

Expand Down
1 change: 1 addition & 0 deletions winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ categories = ["gui"]

[features]
debug = ["iced_native/debug"]
application = []

[dependencies]
window_clipboard = "0.2"
Expand Down
2 changes: 2 additions & 0 deletions winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
pub use iced_native::*;
pub use winit;

#[cfg(feature = "application")]
pub mod application;
pub mod clipboard;
pub mod conversion;
Expand All @@ -38,6 +39,7 @@ mod mode;
mod position;
mod proxy;

#[cfg(feature = "application")]
pub use application::Application;
pub use clipboard::Clipboard;
pub use error::Error;
Expand Down

0 comments on commit 076a523

Please sign in to comment.