Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add instructions to build for Windows on macOS #216

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions x/examples/fyne-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ To run:
go run github.com/Jigsaw-Code/outline-sdk/x/examples/fyne-tools@latest
```

## Android

Package for Android and install on emulator or device:
```
go run fyne.io/fyne/v2/cmd/fyne package -os android && adb install Net_Tools.apk
Expand All @@ -14,6 +16,35 @@ go run fyne.io/fyne/v2/cmd/fyne package -os android && adb install Net_Tools.apk
Note: the generated APK is around 85MB.


## Windows
jyyi1 marked this conversation as resolved.
Show resolved Hide resolved

If you are on Windows, you can just use the regular `go build` or `go run` command.

Because the app uses cgo, we need to cross-compilation tools to build from other platforms.

If you are on macOS, you can build the Windows app with [MinGW-x64](https://www.mingw-w64.org/).

First install MinGW-w64. MacPorts is the [official channel](https://www.mingw-w64.org/downloads/#macports):

```
sudo port install x86_64-w64-mingw32-gcc
```

With Homebrew (unofficial):

```
brew install mingw-w64
```

Build the app (64-bit):

```
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC="x86_64-w64-mingw32-gcc" go build .
```

The first build will take minutes, since there's a lot of platform code to be built.
Subsequent builds will be incremental and take a few seconds.

## Screenshots

<img width="400" alt="image" src="https://github.com/Jigsaw-Code/outline-sdk/assets/113565/8cead9da-461e-41c8-8ce3-f263d77c6ee8">
Expand Down
Loading