From 4d5908387969c7408e74d9de823066e9a79ca334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n?= Date: Thu, 3 Jun 2021 19:25:43 +0700 Subject: [PATCH] Draft `iced_dynamic` crate --- Cargo.toml | 2 ++ dynamic/Cargo.toml | 39 +++++++++++++++++++++++++++++++++++++ dynamic/internal/Cargo.toml | 17 ++++++++++++++++ dynamic/internal/src/lib.rs | 1 + dynamic/src/lib.rs | 5 +++++ 5 files changed, 64 insertions(+) create mode 100644 dynamic/Cargo.toml create mode 100644 dynamic/internal/Cargo.toml create mode 100644 dynamic/internal/src/lib.rs create mode 100644 dynamic/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 6d894eba..148106cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,6 +52,8 @@ maintenance = { status = "actively-developed" } [workspace] members = [ "core", + "dynamic", + "dynamic/internal", "futures", "graphics", "glow", diff --git a/dynamic/Cargo.toml b/dynamic/Cargo.toml new file mode 100644 index 00000000..4d0d7bf9 --- /dev/null +++ b/dynamic/Cargo.toml @@ -0,0 +1,39 @@ +[package] +name = "iced_dynamic" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez "] +edition = "2018" +description = "Dynamic linking for iced" +license = "MIT" +repository = "https://github.com/hecrj/iced" +documentation = "https://docs.rs/iced_dynamic" +keywords = ["gui", "ui", "graphics", "interface", "widgets"] +categories = ["gui"] + +[features] +default = ["wgpu", "default_system_font"] + +# Link `iced` dynamically +dynamic_linking = ["iced_dynamic_internal"] + +# See ../Cargo.toml for descriptions +wgpu = ["iced/wgpu"] +image = ["iced/image"] +svg = ["iced/svg"] +canvas = ["iced/canvas"] +qr_code = ["iced/qr_code"] +default_system_font = ["iced/default_system_font"] +glow = ["iced/glow"] +glow_canvas = ["iced/glow_canvas"] +glow_qr_code = ["iced/glow_qr_code"] +glow_default_system_font = ["iced/glow_default_system_font"] +debug = ["iced/debug"] +tokio = ["iced/tokio"] +tokio_old = ["iced/tokio_old"] +async-std = ["iced/async-std"] +smol = ["iced/smol"] +palette = ["iced/palette"] + +[dependencies] +iced = { version = "0.3", default-features = false, path = ".." } +iced_dynamic_internal = { version = "0.1", path = "internal", optional = true } diff --git a/dynamic/internal/Cargo.toml b/dynamic/internal/Cargo.toml new file mode 100644 index 00000000..4b17cfa4 --- /dev/null +++ b/dynamic/internal/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "iced_dynamic_internal" +version = "0.1.0" +authors = ["Héctor Ramón Jiménez "] +edition = "2018" +description = "Dynamic linking for iced" +license = "MIT" +repository = "https://github.com/hecrj/iced" +documentation = "https://docs.rs/iced_dynamic" +keywords = ["gui", "ui", "graphics", "interface", "widgets"] +categories = ["gui"] + +[lib] +crate-type = ["dylib"] + +[dependencies] +iced = { version = "0.3", default-features = false, path = "../.." } diff --git a/dynamic/internal/src/lib.rs b/dynamic/internal/src/lib.rs new file mode 100644 index 00000000..d88aff1f --- /dev/null +++ b/dynamic/internal/src/lib.rs @@ -0,0 +1 @@ +pub use iced::*; diff --git a/dynamic/src/lib.rs b/dynamic/src/lib.rs new file mode 100644 index 00000000..bab2b587 --- /dev/null +++ b/dynamic/src/lib.rs @@ -0,0 +1,5 @@ +#[cfg(not(feature = "dynamic_linking"))] +pub use iced::*; + +#[cfg(feature = "dynamic_linking")] +pub use iced_dynamic_internal::*;