Fix building for darwin with mage

This commit is contained in:
kolaente 2020-09-03 21:22:41 +02:00
parent 3a839dfb86
commit 19a66450ec
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

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)