Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
[package]
name = "pq-bindings-c-rust"
name = "c_hash_sig_crust"
version = "0.1.0"
edition = "2021"

[lib]
name = "c_hash_sig_crust"
crate-type = ["cdylib", "staticlib"]

[features]
# Feature flag to enable kagome-crates integration
kagome-crates = ["build-helper"]

[dependencies]
hashsig = { git = "https://github.com/b-wagn/hash-sig" }
rand = "0.9"
bincode = { version = "2.0.1", features = ["serde"] }

[build-dependencies]
cbindgen = "0.27"

build-helper = { path = "../build-helper", optional = true }
15 changes: 9 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
extern crate cbindgen;

use std::env;
use std::fs;
use std::path::PathBuf;
#[cfg(feature = "kagome-crates")]
fn main() {
build_helper::run_cbindgen();
}

#[cfg(not(feature = "kagome-crates"))]
fn main() {
use std::env;
use std::fs;
use std::path::PathBuf;

let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let package_name = env::var("CARGO_PKG_NAME").unwrap();

Expand All @@ -26,4 +30,3 @@ fn main() {

println!("cargo:rerun-if-changed=src/lib.rs");
}