Add --strip option to build_dist
Add support for --strip option to strip symbols. Building a rather custom binary with custom flags needs some additional work, and thought to contribute this back up. Signed-off-by: Jamie Sinn <james.sinn@sinndevelopment.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
e69e24d224
commit
a846665599
@@ -51,6 +51,13 @@ while [ "$#" -gt 1 ]; do
|
|||||||
ldflags="$ldflags -w -s"
|
ldflags="$ldflags -w -s"
|
||||||
tags="${tags:+$tags,},$(GOOS= GOARCH= $go run ./cmd/featuretags --min)"
|
tags="${tags:+$tags,},$(GOOS= GOARCH= $go run ./cmd/featuretags --min)"
|
||||||
;;
|
;;
|
||||||
|
--strip)
|
||||||
|
# --min overrides your flags, when you're using custom tags and want to
|
||||||
|
# additionally strip symbols to help reduce the size, this is the easiest
|
||||||
|
# way to do it.
|
||||||
|
shift
|
||||||
|
ldflags="$ldflags -w -s"
|
||||||
|
;;
|
||||||
--box)
|
--box)
|
||||||
if [ ! -z "${TAGS:-}" ]; then
|
if [ ! -z "${TAGS:-}" ]; then
|
||||||
echo "set either --box or \$TAGS, but not both"
|
echo "set either --box or \$TAGS, but not both"
|
||||||
|
|||||||
Reference in New Issue
Block a user