dioxus_config_macros/lib.rs
1/// A macro for deciding whether or not to split the wasm bundle.
2/// Used by the internal router-macro code. The contents here are considered to be semver exempt.
3///
4/// Only on wasm with the wasm-split feature will we prefer the `maybe_wasm_split` variant that emits
5/// the "lefthand" tokens. Otherwise, we emit the non-wasm_split tokens
6#[doc(hidden)]
7#[cfg(all(feature = "wasm-split", target_arch = "wasm32"))]
8#[macro_export]
9macro_rules! maybe_wasm_split {
10 (
11 if wasm_split {
12 $left:tt
13 } else {
14 $right:tt
15 }
16 ) => {
17 $left
18 };
19}
20
21/// A macro for deciding whether or not to split the wasm bundle.
22/// Used by the internal router-macro code. The contents here are considered to be semver exempt.
23///
24/// Only on wasm with the wasm-split feature will we prefer the `maybe_wasm_split` variant that emits
25/// the "lefthand" tokens. Otherwise, we emit the non-wasm_split tokens
26#[doc(hidden)]
27#[cfg(any(not(feature = "wasm-split"), not(target_arch = "wasm32")))]
28#[macro_export]
29macro_rules! maybe_wasm_split {
30 (
31 if wasm_split {
32 $left:tt
33 } else {
34 $right:tt
35 }
36 ) => {
37 $right
38 };
39}