Skip to content

Commit

Permalink
add arm support
Browse files Browse the repository at this point in the history
  • Loading branch information
yuk7 committed Jul 14, 2021
1 parent 3d5bf1f commit be26238
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions cmd/goversioninfo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func main() {
flagCharset := flag.Int("charset", 0, "charset ID")

flag64 := flag.Bool("64", false, "generate 64-bit binaries")
flagarm := flag.Bool("arm", false, "generate arm binaries")

flagVerMajor := flag.Int("ver-major", -1, "FileVersion.Major")
flagVerMinor := flag.Int("ver-minor", -1, "FileVersion.Minor")
Expand Down Expand Up @@ -185,13 +186,22 @@ func main() {

// If platform specific, then output all the architectures for Windows.
if flagPlatformSpecific != nil && *flagPlatformSpecific {
archs = []string{"386", "amd64"}
archs = []string{"386", "amd64", "arm", "arm64"}
} else {
// Set the architecture, defaulted to 32-bit.
archs = []string{"386"} // 32-bit
if flag64 != nil && *flag64 {
archs = []string{"amd64"} // 64-bit
// Set the architecture, defaulted to 386(32-bit x86).
archs = []string{"386"} // 386(32-bit x86)
if flagarm != nil && *flagarm {
if flag64 != nil && *flag64 {
archs = []string{"arm64"} // arm64(64-bit arm64)
} else {
archs = []string{"arm"} // arm(32-bit arm)
}
} else {
if flag64 != nil && *flag64 {
archs = []string{"amd64"} // amd64(64-bit x86_64)
}
}

}

// Loop through each artchitecture.
Expand Down

0 comments on commit be26238

Please sign in to comment.