From 10fc7d762b4f67e927d77db4ef67bafabfe4b05a Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Tue, 21 Apr 2020 06:55:16 +1000 Subject: [PATCH] fixes to OSX cross compile --- cmd/package.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/cmd/package.go b/cmd/package.go index ceb9a44b..48fb38df 100644 --- a/cmd/package.go +++ b/cmd/package.go @@ -72,17 +72,6 @@ func (b *PackageHelper) getPackageFileBaseDir() string { func (b *PackageHelper) Package(po *ProjectOptions) error { switch b.platform { case "darwin": - // Check we have the exe - if !b.fs.FileExists(po.BinaryName) { - // Check cross-compiled application - if b.platform == runtime.GOOS { - return fmt.Errorf("cannot bundle non-existent binary file '%s'. Please build with 'wails build' first", po.BinaryName) - } - - if _, err := b.fs.FindFile(path.Join(b.fs.Cwd(), "build"), "darwin"); err != nil { - return fmt.Errorf("cannot bundle non-existent cross-compiled binary file '%s'. Please build with 'wails build -x darwin/amd64' first", po.BinaryName) - } - } return b.packageOSX(po) case "windows": return b.PackageWindows(po, true) @@ -117,7 +106,7 @@ func (b *PackageHelper) packageOSX(po *ProjectOptions) error { // Check binary exists source := path.Join(build, exe) - if b.platform != runtime.GOOS { + if po.CrossCompile == true { file, err := b.fs.FindFile(build, "darwin") if err != nil { return err @@ -127,7 +116,7 @@ func (b *PackageHelper) packageOSX(po *ProjectOptions) error { if !b.fs.FileExists(source) { // We need to build! - return fmt.Errorf("Target '%s' not available. Has it been compiled yet?", exe) + return fmt.Errorf("Target '%s' not available. Has it been compiled yet?", source) } // Remove the existing package os.RemoveAll(appname)