refactor: move cargo build options to .build.sh

This commit is contained in:
DarkCat09 2024-12-21 21:58:03 +04:00
parent 37af0426b7
commit 8fa8e98b99
Signed by: DarkCat09
GPG key ID: BD3CE9B65916CD82
2 changed files with 19 additions and 7 deletions

View file

@ -39,3 +39,21 @@ make_maxthreads() {
JOBS="${JOBS//[^0-9]/}"
make -j"$JOBS"
}
# alias build_rust="cargo build -r"
build_rust () {
cargo build \
--release \
--config 'panic="abort"' \
--config 'lto="fat"' \
--config 'codegen-units=1' \
"$@"
}
# just disabling debugging
build_go () {
go build -v \
-trimpath \
-ldflags "-s -w -buildid=" \
"$@"
}

View file

@ -17,13 +17,7 @@ set_cflags
echo
echo '==> Building resolve'
cargo build \
--release \
--bin resolve \
--features dnssec-ring \
--config 'panic="abort"' \
--config 'lto="fat"' \
--config 'codegen-units=1'
build_rust --bin resolve --features dnssec-ring
echo
echo '==> Done'