Skip to content
Merged
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
778 changes: 337 additions & 441 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion DashSharedCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |s|

s.prepare_command = <<-CMD
cd dash-spv-apple-bindings
./build.sh debug
./build.sh
CMD

s.source_files = 'dash-spv-apple-bindings/target/include/**/*.h'
Expand Down
1 change: 1 addition & 0 deletions dash-spv-apple-bindings/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
./.cargo/
Cargo.lock
DashSharedCore
tmp

# These are backup files generated by rustfmt
**/*.rs.bk
Expand Down
1 change: 1 addition & 0 deletions dash-spv-apple-bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ ferment-sys = { version = "0.2", package = "ferment-sys" }
#ferment-sys = { path = "../../ferment/ferment-sys", features = ["objc"] }

[features]
fermentize = []
default = ["state-transitions", "std", "message_verification", "quorum_validation"]
bls-signatures = ["dpp/bls-signatures"]
blsful = ["dashcore/blsful"]
Expand Down
7 changes: 6 additions & 1 deletion dash-spv-apple-bindings/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
extern crate ferment_sys;

#[cfg(feature = "fermentize")]
use ferment_sys::Ferment;
// #[cfg(feature = "objc")]
// use ferment_sys::{Lang, ObjC, XCodeConfig};
Expand All @@ -11,7 +12,7 @@ fn main() {
return; // Exit early in debug mode
}
}

#[cfg(feature = "fermentize")]
match Ferment::with_crate_name("dash_spv_apple_bindings")
.with_cbindgen_config_from_file("cbindgen.toml")
.with_default_mod_name()
Expand Down Expand Up @@ -40,4 +41,8 @@ fn main() {
Ok(_) => println!("[ferment] [ok]"),
Err(err) => panic!("[ferment] [err]: {}", err)
}
#[cfg(not(feature = "fermentize"))]
{
println!("Fermentation is disabled. Skipping build.rs.");
}
}
14 changes: 13 additions & 1 deletion dash-spv-apple-bindings/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,23 @@ else
features=""
fi

fermentize=1
for target in "${build_targets[@]}"; do
echo "▶ Building for $target"
lib_path="../../target/$target/$BUILD_TYPE/lib${LIB_NAME}.a"

if [ "$fermentize" -eq 1 ]; then
extra_features="fermentize"
fermentize=0
else
extra_features=""
fi

if [ ! -f "$lib_path" ]; then
cargo +nightly -Z build-std=std,compiler_builtins build --features="$features" --target="$target" --"$BUILD_FLAG"
cargo +nightly -Z build-std=std,compiler_builtins build \
--features="$features $extra_features" \
--target="$target" \
--"$BUILD_FLAG"
fi
done

Expand Down
Loading
Loading