Skip to content

Commit

Permalink
Allow setting CGO_ENABLED
Browse files Browse the repository at this point in the history
Makefile: Allow setting CGO_ENABLED (defaults to 0).
  • Loading branch information
dvzrv committed Apr 18, 2023
1 parent 464d645 commit ae7a5eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ PROJECT := github.com/kubernetes-sigs/cri-tools
BINDIR ?= /usr/local/bin

VERSION ?= $(shell git describe --tags --dirty --always | sed 's/^v//')
CGO_ENABLED ?= 0
GOFLAGS ?= -trimpath
GO_LDFLAGS := $(GO_LDFLAGS) -X $(PROJECT)/pkg/version.Version=$(VERSION)

Expand Down Expand Up @@ -64,7 +65,7 @@ critest:
@$(MAKE) -B $(CRITEST)

$(CRITEST):
CGO_ENABLED=0 $(GO_TEST) -c -o $@ \
CGO_ENABLED=$(CGO_ENABLED) $(GO_TEST) -c -o $@ \
-ldflags '$(GO_LDFLAGS)' \
$(GOFLAGS) \
$(PROJECT)/cmd/critest
Expand All @@ -73,7 +74,7 @@ crictl:
@$(MAKE) -B $(CRICTL)

$(CRICTL):
CGO_ENABLED=0 $(GO_BUILD) -o $@ \
CGO_ENABLED=$(CGO_ENABLED) $(GO_BUILD) -o $@ \
-ldflags '$(GO_LDFLAGS)' \
$(GOFLAGS) \
$(PROJECT)/cmd/crictl
Expand Down

0 comments on commit ae7a5eb

Please sign in to comment.