cmd/gogio: add support for Windows

Now, gogio can build the program for Windows, using the `-target
windows`.

It will build with `-H=windowsgui`, by default. Also, it can compile for
multiple platforms if specified using `-target` (e.g. `-target arm, 386,
amd64`), the executable will have the respective suffix (i.e.
`_386.exe`).

gogio will also attach (any) appicon.png as executable icon resource and
include some information about the file and supported operating system.

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
Inkeliz
2020-12-10 15:17:30 +00:00
committed by Elias Naur
parent 0b2a2d6c2e
commit fa96e12b6d
6 changed files with 385 additions and 45 deletions
+2 -6
View File
@@ -222,12 +222,8 @@ int main(int argc, char * argv[]) {
if err := ioutil.WriteFile(plistFile, []byte(infoPlist), 0660); err != nil {
return err
}
icon := *iconPath
if icon == "" {
icon = filepath.Join(bi.pkgDir, "appicon.png")
}
if _, err := os.Stat(icon); err == nil {
assetPlist, err := iosIcons(bi, tmpDir, app, icon)
if _, err := os.Stat(bi.iconPath); err == nil {
assetPlist, err := iosIcons(bi, tmpDir, app, bi.iconPath)
if err != nil {
return err
}