Skip to content

Commit fef9cfc

Browse files
author
jld3103
authored
Merge pull request #184 from go-flutter-desktop/fix/linux-aot-cross-compilation
Fix linux AOT cross-compilation
2 parents 7e7b864 + 6f617cf commit fef9cfc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cmd/build.go

+5
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,11 @@ func validateBuildParameters(targetOS string) {
356356
log.Errorf("To cross-compile AOT apps for darwin on %s install darling from your package manager or https://www.darlinghq.org/", runtime.GOOS)
357357
os.Exit(1)
358358
}
359+
} else if targetOS == "linux" {
360+
if !buildOrRunDocker {
361+
log.Errorf("To cross-compile AOT apps for linux on %s use the `--docker` flag", runtime.GOOS)
362+
os.Exit(1)
363+
}
359364
} else {
360365
log.Errorf("AOT builds currently only work on their host OS")
361366
os.Exit(1)

internal/enginecache/cache.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"os/exec"
1111
"path/filepath"
12+
"runtime"
1213
"strconv"
1314
"strings"
1415
"time"
@@ -337,7 +338,7 @@ func ValidateOrUpdateEngine(targetOS, cachePath, requiredEngineVersion string, m
337338
}
338339

339340
// Strip linux engine after download and not at every build
340-
if targetOS == "linux" {
341+
if targetOS == "linux" && targetOS == runtime.GOOS {
341342
unstrippedEngineFile := filepath.Join(engineCachePath, build.EngineFiles(targetOS, mode)[0])
342343
err = exec.Command("strip", "-s", unstrippedEngineFile).Run()
343344
if err != nil {

0 commit comments

Comments
 (0)