mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 14:48:08 -05:00
cargo: Enable lto and native bytecode.
This commit is contained in:
@@ -11,6 +11,11 @@ edition = "2021"
|
||||
[lib]
|
||||
name = "darkfi"
|
||||
|
||||
[profile.release]
|
||||
debug = true
|
||||
lto = "fat"
|
||||
codegen-units = 1
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"bin/zkas",
|
||||
|
||||
15
Makefile
15
Makefile
@@ -6,6 +6,9 @@ PREFIX = /usr/local
|
||||
# Cargo binary
|
||||
CARGO = cargo
|
||||
|
||||
# Flags passed to cargo/rustc
|
||||
RUSTFLAGS = -C target-cpu=native
|
||||
|
||||
# Binaries to be built
|
||||
BINS = zkas drk darkfid gatewayd
|
||||
|
||||
@@ -24,17 +27,17 @@ token_lists:
|
||||
$(MAKE) -C contrib/token all
|
||||
|
||||
$(BINS): token_lists $(BINDEPS)
|
||||
$(CARGO) build --all-features --release --package $@
|
||||
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --all-features --release --package $@
|
||||
cp -f target/release/$@ $@
|
||||
|
||||
check:
|
||||
$(CARGO) hack check --release --feature-powerset --all
|
||||
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) hack check --release --feature-powerset --all
|
||||
|
||||
fix:
|
||||
$(CARGO) clippy --release --all-features --fix --allow-dirty --all
|
||||
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clippy --release --all-features --fix --allow-dirty --all
|
||||
|
||||
clippy:
|
||||
$(CARGO) clippy --release --all-features --all
|
||||
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) clippy --release --all-features --all
|
||||
|
||||
# zkas source files which we want to compile for tests
|
||||
VM_SRC = proof/arithmetic.zk proof/mint.zk proof/burn.zk
|
||||
@@ -44,10 +47,10 @@ $(VM_BIN): zkas $(VM_SRC)
|
||||
./zkas $(basename $@) -o $@
|
||||
|
||||
test: $(VM_BIN) test-tx
|
||||
$(CARGO) test --release --all-features --all
|
||||
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) test --release --all-features --all
|
||||
|
||||
test-tx:
|
||||
$(CARGO) run --release --features=node,zkas --example tx
|
||||
RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) run --release --features=node,zkas --example tx
|
||||
|
||||
clean:
|
||||
rm -f $(BINS)
|
||||
|
||||
Reference in New Issue
Block a user