From 8fa8e98b9901bd4d6ff70ef9ca64764b5a0e2beb Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Sat, 21 Dec 2024 21:58:03 +0400 Subject: [PATCH] refactor: move cargo build options to .build.sh --- .build.sh | 18 ++++++++++++++++++ build_hr.sh | 8 +------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.build.sh b/.build.sh index 63a4bbb..99cd3cf 100644 --- a/.build.sh +++ b/.build.sh @@ -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=" \ + "$@" +} diff --git a/build_hr.sh b/build_hr.sh index 3566134..0e25371 100755 --- a/build_hr.sh +++ b/build_hr.sh @@ -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'