浏览代码

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 年之前
父节点
当前提交
f76b21b02c
共有 1 个文件被更改,包括 9 次插入2 次删除
  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() {
 	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
 }