Skip to content

Commit 9e6c558

Browse files
committed
make:detect profile: make cargo-build-release profile=release-with-debug
1 parent abc180e commit 9e6c558

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ categories = [
2828
# benchmarks are using criterion
2929
bench = false
3030

31+
## [profile.release]
32+
## debug = true
33+
34+
[profile.release-with-debug]
35+
inherits = "release"
36+
debug = true
37+
3138
[dependencies]
3239
async-channel = "1"
3340
snow = { version = "0.9", features = ["risky-raw-split"] }

GNUmakefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ PROJECT_NAME := $(project)
55
endif
66
export PROJECT_NAME
77

8+
## https://doc.rust-lang.org/cargo/reference/profiles.html#custom-profiles
9+
## CARGO_PROFILE_RELEASE_DEBUG
10+
ifeq ($(profile),)
11+
PROFILE=release
12+
else
13+
PROFILE=release-with-debug
14+
endif
15+
816
OS :=$(shell uname -s)
917
export OS
1018
OS_VERSION :=$(shell uname -r)

cargo.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cargo-br:cargo-build-release### cargo-br
1515
cargo-build-release:### cargo-build-release
1616
## make cargo-build-release q=true
1717
@. $(HOME)/.cargo/env
18-
@cargo b --release $(QUIET)
18+
@cargo b $(QUIET) --profile=$(PROFILE)
1919
cargo-check:### cargo-check
2020
## cargo c
2121
@. $(HOME)/.cargo/env

0 commit comments

Comments
 (0)