diff options
author | Ayke van Laethem <[email protected]> | 2022-08-12 14:39:43 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-08-13 12:43:38 +0200 |
commit | a0407be7b7047c99871114ad9e4bfc6279502803 (patch) | |
tree | a8dba2bf72cc44fc01f682105fa04b7e96861b84 /goenv | |
parent | e70dfa4dd6c5c1ab779e3fc2a3bfc6f3e8b74c88 (diff) | |
download | tinygo-a0407be7b7047c99871114ad9e4bfc6279502803.tar.gz tinygo-a0407be7b7047c99871114ad9e4bfc6279502803.zip |
goenv: support GOOS=android
TinyGo doesn't currently support Android directly. However, GOOS=linux
works fine on Android. Therefore, force GOOS=linux on Android.
Diffstat (limited to 'goenv')
-rw-r--r-- | goenv/goenv.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/goenv/goenv.go b/goenv/goenv.go index 1e62eb35b..d87f6f2e9 100644 --- a/goenv/goenv.go +++ b/goenv/goenv.go @@ -42,10 +42,14 @@ var TINYGOROOT string func Get(name string) string { switch name { case "GOOS": - if dir := os.Getenv("GOOS"); dir != "" { - return dir + goos := os.Getenv("GOOS") + if goos == "" { + goos = runtime.GOOS + } + if goos == "android" { + goos = "linux" } - return runtime.GOOS + return goos case "GOARCH": if dir := os.Getenv("GOARCH"); dir != "" { return dir |