Skip to content

Commit

Permalink
Add features.
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraSuegami committed Sep 27, 2023
1 parent e5e6d5c commit 98f5483
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions packages/apis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ serde_json = "1.0.95"
version = "0.10"
default-features = false
features = ["napi-6"]

[features]
default = ["export_neon_main"]
export_neon_main = []
1 change: 1 addition & 0 deletions packages/apis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub mod padding;
use extract_substrs::extract_substr_idxes_node;
use padding::pad_string_node;

#[cfg(feature = "export_neon_main")]
#[neon::main]
fn main(mut cx: ModuleContext) -> NeonResult<()> {
cx.export_function("extractSubstrIdxes", extract_substr_idxes_node)?;
Expand Down
5 changes: 2 additions & 3 deletions packages/compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ clap = { version = "=4.2.1", features = ["derive"] }
version = "0.10"
default-features = false
features = ["napi-6"]
optional = true

[features]
default = ["node"]
node = ["neon"]
default = ["export_neon_main"]
export_neon_main = []
5 changes: 1 addition & 4 deletions packages/compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ pub mod circom;
pub mod halo2;
pub mod js_caller;

#[cfg(feature = "node")]
pub mod node;
#[cfg(feature = "node")]
use crate::node::*;
#[cfg(feature = "node")]
use neon;

use crate::js_caller::*;
Expand Down Expand Up @@ -462,7 +459,7 @@ pub(crate) fn add_graph_nodes(
Ok(())
}

#[cfg(feature = "node")]
#[cfg(feature = "export_neon_main")]
#[neon::main]
fn main(mut cx: neon::prelude::ModuleContext) -> neon::prelude::NeonResult<()> {
cx.export_function("genFromDecomposed", gen_from_decomposed_node)?;
Expand Down

0 comments on commit 98f5483

Please sign in to comment.