Browse Source

Fix mobile build on windows

gobind executable name is not exactly `gobind` on windows it's `gobind.exe`

Signed-off-by: Devman <[email protected]>
Devman 1 year ago
parent
commit
f76b21b02c
1 changed files with 9 additions and 2 deletions
  1. 9 2
      cmd/internal/build_shared/sdk.go

+ 9 - 2
cmd/internal/build_shared/sdk.go

@@ -85,8 +85,15 @@ var GoBinPath string
 
 
 func FindMobile() {
 func FindMobile() {
 	goBin := filepath.Join(build.Default.GOPATH, "bin")
 	goBin := filepath.Join(build.Default.GOPATH, "bin")
-	if !rw.FileExists(goBin + "/" + "gobind") {
-		log.Fatal("missing gomobile installation")
+
+	if runtime.GOOS == "windows" {
+		if !rw.FileExists(goBin + "/" + "gobind.exe") {
+			log.Fatal("missing gomobile.exe installation")
+		}
+	} else {
+		if !rw.FileExists(goBin + "/" + "gobind") {
+			log.Fatal("missing gomobile installation")
+		}
 	}
 	}
 	GoBinPath = goBin
 	GoBinPath = goBin
 }
 }