[package] name = "peace_rt_model_hack" description = "Hack to selectively enable features in target specific crates." documentation = "https://docs.rs/peace_rt_model_hack/" authors.workspace = true version.workspace = true edition.workspace = true repository.workspace = true homepage.workspace = true readme.workspace = true categories.workspace = true keywords.workspace = true license.workspace = true [lib] doctest = false test = false [dependencies] # We are not able to have target specific features in `peace_rt_model`: # # # [target.'cfg(not(target_arch = "wasm32"))'.features] # error_reporting = ["peace_rt_model_native?/error_reporting"] # # [target.'cfg(target_arch = "wasm32")'.features] # error_reporting = ["peace_rt_model_web?/error_reporting"] # # As a workaround, we use the `peace_rt_model_hack` bridging crate that always # enables the feature per target, and we use a feature in this crate to toggle # the enablement of the bridging crate. This is the workaround suggested here: # # [target.'cfg(not(target_arch = "wasm32"))'.dependencies] peace_rt_model_native = { workspace = true } [target.'cfg(target_arch = "wasm32")'.dependencies] peace_rt_model_web = { workspace = true } [features] default = [] error_reporting = [ "peace_rt_model_native/error_reporting", "peace_rt_model_web/error_reporting", ] output_progress = [ "peace_rt_model_native/output_progress", "peace_rt_model_web/output_progress", ]