Skip to content

Commit

Permalink
Merge pull request #1612 from andydotxyz/fix/886
Browse files Browse the repository at this point in the history
Apply min macOS version as 10.11 like the app store packaging
  • Loading branch information
andydotxyz committed Nov 27, 2020
2 parents 8a84b1e + 99cb61e commit e5f30d6
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions cmd/fyne/commands/build.go
Expand Up @@ -20,18 +20,23 @@ func (b *builder) build() error {
goos = targetOS()
}

args := []string{}
args := []string{"build"}
env := os.Environ()
env = append(env, "CGO_ENABLED=1") // in case someone is trying to cross-compile...

if goos == "windows" {
if b.release {
args = append(args, "build", "-ldflags", "-s -w -H=windowsgui")
args = append(args, "-ldflags", "-s -w -H=windowsgui")
} else {
args = append(args, "build", "-ldflags", "-H=windowsgui")
args = append(args, "-ldflags", "-H=windowsgui")
}
} else {
if goos == "darwin" {
env = append(env, "CGO_CFLAGS=-mmacosx-version-min=10.11")
env = append(env, "CGO_LDFLAGS=-mmacosx-version-min=10.11")
}
if b.release {
args = append(args, "build", "-ldflags", "-s -w")
} else {
args = append(args, "build")
args = append(args, "-ldflags", "-s -w")
}
}

Expand All @@ -46,9 +51,6 @@ func (b *builder) build() error {

cmd := exec.Command("go", args...)
cmd.Dir = b.srcdir
env := os.Environ()
env = append(env, "CGO_ENABLED=1") // in case someone is trying to cross-compile...

if goos != "ios" && goos != "android" {
env = append(env, "GOOS="+goos)
}
Expand Down

0 comments on commit e5f30d6

Please sign in to comment.