Skip to content

Commit

Permalink
Apply min macOS version as 10.11 like the app store packaging
Browse files Browse the repository at this point in the history
This suppports most computers sold in the last 12 years
and goes beyond Apple support plans.

Fixes fyne-io#886
  • Loading branch information
andydotxyz committed Nov 27, 2020
1 parent 8a84b1e commit 99cb61e
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 99cb61e

Please sign in to comment.