Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ license = "Apache-2.0"
default = ["gpu", "shader-nodes"]
gpu = ["editor/gpu"]
shader-nodes = ["graphene-std/shader-nodes", "gpu"]
native = []
native = ["node-macro/disable-registration"]

[lib]
crate-type = ["cdylib", "rlib"]
Expand All @@ -39,6 +39,7 @@ wgpu = { workspace = true }
web-sys = { workspace = true }
ron = { workspace = true }
serde_json = { workspace = true }
node-macro = { workspace = true }

[package.metadata.wasm-pack.profile.dev]
wasm-opt = false
Expand Down
3 changes: 3 additions & 0 deletions node-graph/node-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ license = "Apache-2.0"
[lib]
proc-macro = true

[features]
disable-registration = []

[dependencies]
# Workspace dependencies
syn = { workspace = true }
Expand Down
4 changes: 4 additions & 0 deletions node-graph/node-macro/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,10 @@ fn generate_register_node_impl(parsed: &ParsedNodeFn, field_names: &[&Ident], st
}
let registry_name = format_ident!("__node_registry_{}_{}", NODE_ID.fetch_add(1, std::sync::atomic::Ordering::SeqCst), struct_name);

if cfg!(feature = "disable-registration") {
return Ok(quote!());
}

Ok(quote! {

#[cfg_attr(not(target_family = "wasm"), ctor)]
Expand Down
Loading