Skip to content

Commit ae7a5eb

Browse files
committed
Allow setting CGO_ENABLED
Makefile: Allow setting CGO_ENABLED (defaults to 0).
1 parent 464d645 commit ae7a5eb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ PROJECT := github.com/kubernetes-sigs/cri-tools
3434
BINDIR ?= /usr/local/bin
3535

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

@@ -64,7 +65,7 @@ critest:
6465
@$(MAKE) -B $(CRITEST)
6566

6667
$(CRITEST):
67-
CGO_ENABLED=0 $(GO_TEST) -c -o $@ \
68+
CGO_ENABLED=$(CGO_ENABLED) $(GO_TEST) -c -o $@ \
6869
-ldflags '$(GO_LDFLAGS)' \
6970
$(GOFLAGS) \
7071
$(PROJECT)/cmd/critest
@@ -73,7 +74,7 @@ crictl:
7374
@$(MAKE) -B $(CRICTL)
7475

7576
$(CRICTL):
76-
CGO_ENABLED=0 $(GO_BUILD) -o $@ \
77+
CGO_ENABLED=$(CGO_ENABLED) $(GO_BUILD) -o $@ \
7778
-ldflags '$(GO_LDFLAGS)' \
7879
$(GOFLAGS) \
7980
$(PROJECT)/cmd/crictl

0 commit comments

Comments
 (0)