From 4a622348f20e1ef4c5e421e64701569754ebd9b7 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Fri, 29 Mar 2024 20:22:41 -0500 Subject: [PATCH] Fix the mobile feature on the dioxus crate (#2185) --- Cargo.lock | 2 +- packages/dioxus/src/launch.rs | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 67a4ef30b..4096c5791 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2143,7 +2143,7 @@ dependencies = [ [[package]] name = "dioxus-cli" -version = "0.5.0" +version = "0.5.4" dependencies = [ "anyhow", "atty", diff --git a/packages/dioxus/src/launch.rs b/packages/dioxus/src/launch.rs index 44231862e..90461e612 100644 --- a/packages/dioxus/src/launch.rs +++ b/packages/dioxus/src/launch.rs @@ -182,11 +182,15 @@ impl LaunchBuilder { /// - `liveview` mod current_platform { macro_rules! if_else_cfg { - (if $attr:meta { $then:item } else { $else:item }) => { - #[cfg($attr)] - $then - #[cfg(not($attr))] - $else + (if $attr:meta { $($then:item)* } else { $($else:item)* }) => { + $( + #[cfg($attr)] + $then + )* + $( + #[cfg(not($attr))] + $else + )* }; } use crate::prelude::TryIntoConfig; @@ -194,7 +198,10 @@ mod current_platform { #[cfg(any(feature = "desktop", feature = "mobile"))] if_else_cfg! { if not(feature = "fullstack") { + #[cfg(feature = "desktop")] pub use dioxus_desktop::launch::*; + #[cfg(not(feature = "desktop"))] + pub use dioxus_mobile::launch::*; } else { impl TryIntoConfig for ::dioxus_desktop::Config { fn into_config(self) -> Option {