Fix building for darwin with mage
continuous-integration/drone/push Build is failing Details

This commit is contained in:
kolaente 2020-09-03 21:22:41 +02:00
parent 3a839dfb86
commit 19a66450ec
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 9 additions and 1 deletions

View File

@ -492,10 +492,18 @@ func (Release) Dirs() error {
func runXgo(targets string) error {
checkAndInstallGoTool("xgo", "src.techknowlogick.com/xgo")
extraLdflags := `-linkmode external -extldflags "-static" `
// See https://github.com/techknowlogick/xgo/issues/79
if strings.HasPrefix(targets, "darwin") {
extraLdflags = ""
}
runAndStreamOutput("xgo",
"-dest", RootPath+"/"+DIST+"/binaries",
"-tags", "netgo "+Tags,
"-ldflags", `-linkmode external -extldflags "-static" `+Ldflags,
"-ldflags", extraLdflags+Ldflags,
"-targets", targets,
"-out", Executable+"-"+Version,
RootPath)