build: use cgo by default

native-modules
sammyette 2023-07-10 21:41:35 -04:00
parent a0a22d6e93
commit 109eac528c
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 10 additions and 0 deletions

View File

@ -13,12 +13,22 @@ vars:
tasks: tasks:
default: default:
cmds:
- go build {{.GOFLAGS}}
vars:
GOFLAGS: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}} -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"'
default-nocgo:
cmds: cmds:
- CGO_ENABLED=0 go build {{.GOFLAGS}} - CGO_ENABLED=0 go build {{.GOFLAGS}}
vars: vars:
GOFLAGS: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}} -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"' GOFLAGS: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}} -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"'
build: build:
cmds:
- go build {{.GOFLAGS}}
build-nocgo:
cmds: cmds:
- CGO_ENABLED=0 go build {{.GOFLAGS}} - CGO_ENABLED=0 go build {{.GOFLAGS}}