From 5609706d9b19d9a67d8fce6a813e0a478df13508 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 29 Aug 2022 11:27:20 +0000 Subject: [PATCH] build: Build Rust library and binaries at the same time This enables `cargo` to parallelize the library and binary builds internally, reducing the Rust build time by the build time of the binaries (because they are overall faster than the library build). Part of zcash/zcash#6065. --- src/Makefile.am | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index b7ad3e0c1..72cff51c9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -132,11 +132,12 @@ LIBBITCOIN_CRYPTO_SHANI = crypto/libbitcoin_crypto_shani.a LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_SHANI) endif -cargo-build-lib: $(CARGO_CONFIGURED) - $(rust_verbose)$(RUST_ENV_VARS) $(CARGO) build --lib $(RUST_BUILD_OPTS) $(cargo_verbose) +cargo-build: $(CARGO_CONFIGURED) $(LIBSECP256K1) + $(rust_verbose)$(RUST_ENV_VARS) $(CARGO) build $(RUST_BUILD_OPTS) $(cargo_verbose) -cargo-build-bins: $(CARGO_CONFIGURED) $(LIBSECP256K1) - $(rust_verbose)$(RUST_ENV_VARS) $(CARGO) build --bins $(RUST_BUILD_OPTS) $(cargo_verbose) +cargo-build-lib: cargo-build + +cargo-build-bins: cargo-build $(INSPECT_TOOL_BIN): cargo-build-bins $(AM_V_at)cp $(INSPECT_TOOL_BUILD) $@