Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Enables cgo for freebsd builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jcooklin committed Feb 14, 2017
1 parent a57fd48 commit 3b83b53
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/build_snap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ go_build=(go build -ldflags "-w -X main.gitversion=${git_version}")
_info "snap build version: ${git_version}"
_info "git commit: $(git log --pretty=format:"%H" -1)"

# Disable CGO for builds.
export CGO_ENABLED=0

# rebuild binaries:
export GOOS=${GOOS:-$(go env GOOS)}
export GOARCH=${GOARCH:-$(go env GOARCH)}

# Disable CGO for builds (except freebsd)
if [[ "${GOOS}" == "freebsd" ]]; then
_info "CGO enabled for freebsd"
export CGO_ENABLED=1
else
export CGO_ENABLED=0
fi

if [[ "${GOARCH}" == "amd64" ]]; then
build_path="${__proj_dir}/build/${GOOS}/x86_64"
else
Expand Down

0 comments on commit 3b83b53

Please sign in to comment.