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.
This commit is contained in:
Jack Grigg 2022-08-29 11:27:20 +00:00
parent d3e8b3b114
commit 5609706d9b
1 changed files with 5 additions and 4 deletions

View File

@ -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) $@