Fix building for darwin with mage
This commit is contained in:
parent
3a839dfb86
commit
19a66450ec
1 changed files with 9 additions and 1 deletions
10
magefile.go
10
magefile.go
|
@ -492,10 +492,18 @@ func (Release) Dirs() error {
|
||||||
|
|
||||||
func runXgo(targets string) error {
|
func runXgo(targets string) error {
|
||||||
checkAndInstallGoTool("xgo", "src.techknowlogick.com/xgo")
|
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",
|
runAndStreamOutput("xgo",
|
||||||
"-dest", RootPath+"/"+DIST+"/binaries",
|
"-dest", RootPath+"/"+DIST+"/binaries",
|
||||||
"-tags", "netgo "+Tags,
|
"-tags", "netgo "+Tags,
|
||||||
"-ldflags", `-linkmode external -extldflags "-static" `+Ldflags,
|
"-ldflags", extraLdflags+Ldflags,
|
||||||
"-targets", targets,
|
"-targets", targets,
|
||||||
"-out", Executable+"-"+Version,
|
"-out", Executable+"-"+Version,
|
||||||
RootPath)
|
RootPath)
|
||||||
|
|
Loading…
Reference in a new issue