Add build option to Makefile for removing static compile flags (#3026)

this make it possible to remove one patch file from
https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/testing/woodpecker
This commit is contained in:
6543 2023-12-27 13:01:56 +01:00 committed by GitHub
parent 840fca198e
commit eefa64e2d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,7 +27,11 @@ else
endif
endif
LDFLAGS := -s -w -extldflags "-static" -X go.woodpecker-ci.org/woodpecker/v2/version.Version=${VERSION}
LDFLAGS := -X go.woodpecker-ci.org/woodpecker/v2/version.Version=${VERSION}
STATIC_BUILD ?= true
ifeq ($(STATIC_BUILD),true)
LDFLAGS := -s -w -extldflags "-static" $(LDFLAGS)
endif
CGO_ENABLED ?= 1 # only used to compile server
HAS_GO = $(shell hash go > /dev/null 2>&1 && echo "GO" || echo "NOGO" )