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 Jan 15, 2022
1 parent b7bc169 commit f1fb67a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
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_system_font"]
default = ["wgpu", "default_system_font", "application"]
application = ["iced_winit/application"]
# Enables the `iced_wgpu` renderer
wgpu = ["iced_wgpu"]
# Enables the `Image` widget
Expand Down
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 Down Expand Up @@ -234,11 +237,13 @@ use iced_web as runtime;
#[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 f1fb67a

Please sign in to comment.