diff --git a/Cargo.toml b/Cargo.toml index 9463a7173..cf0d61883 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,4 +7,5 @@ members = [ resolver = "2" [workspace.dependencies] +serde = { version = "1", features = ["serde_derive"] } winit-core = { path = "./winit-core", default-features = false, features = ["std"] } diff --git a/winit-core/Cargo.toml b/winit-core/Cargo.toml index 3843627d0..9c5f3c0b3 100644 --- a/winit-core/Cargo.toml +++ b/winit-core/Cargo.toml @@ -16,3 +16,7 @@ rust-version = "1.70.0" default = ["std"] std = ["alloc"] alloc = [] +serde = ["dep:serde"] + +[dependencies] +serde = { workspace = true, optional = true } diff --git a/winit/src/dpi.rs b/winit-core/src/dpi.rs similarity index 100% rename from winit/src/dpi.rs rename to winit-core/src/dpi.rs diff --git a/winit-core/src/lib.rs b/winit-core/src/lib.rs index bd0dc6304..4a110b19c 100644 --- a/winit-core/src/lib.rs +++ b/winit-core/src/lib.rs @@ -10,4 +10,5 @@ #[cfg(any(not(feature = "std"), not(feature = "alloc")))] compile_error! { "no-std and no-alloc usage are not yet supported" } +pub mod dpi; pub mod error; diff --git a/winit/Cargo.toml b/winit/Cargo.toml index 585f14ce3..c312bf891 100644 --- a/winit/Cargo.toml +++ b/winit/Cargo.toml @@ -69,7 +69,7 @@ once_cell = "1.12" rwh_04 = { package = "raw-window-handle", version = "0.4", optional = true } rwh_05 = { package = "raw-window-handle", version = "0.5.2", features = ["std"], optional = true } rwh_06 = { package = "raw-window-handle", version = "0.6", features = ["std"], optional = true } -serde = { version = "1", optional = true, features = ["serde_derive"] } +serde = { workspace = true, optional = true } smol_str = "0.2.0" winit-core.workspace = true diff --git a/winit/src/lib.rs b/winit/src/lib.rs index a746f3e57..079661a5d 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -164,7 +164,9 @@ #[cfg(feature = "rwh_06")] pub use rwh_06 as raw_window_handle; -pub mod dpi; +#[doc(inline)] +pub use winit_core::dpi; + #[macro_use] pub mod error; mod cursor;