Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply min macOS version as 10.11 like the app store packaging #1612

Merged
merged 1 commit into from Nov 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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")
Jacalz marked this conversation as resolved.
Show resolved Hide resolved
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