Browse Source

windows binary with subsystem window

pull/432/head
Darien Raymond 8 years ago
parent
commit
41a9aec10e
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
  1. 15
      tools/build/build.go
  2. 4
      tools/build/go.go

15
tools/build/build.go

@ -76,16 +76,29 @@ func build(targetOS, targetArch string, archive bool, version string, metadataFi
targetFile := getTargetFile(v2rayOS)
targetFileFull := filepath.Join(targetDir, targetFile)
err = buildV2Ray(targetFileFull, version, v2rayOS, v2rayArch)
err = buildV2Ray(targetFileFull, version, v2rayOS, v2rayArch, "")
if err != nil {
fmt.Println("Unable to build V2Ray: " + err.Error())
}
if v2rayOS == Windows {
err = buildV2Ray(filepath.Join(targetDir, "w"+targetFile), version, v2rayOS, v2rayArch, "-H windowsgui")
if err != nil {
fmt.Println("Unable to build V2Ray no console: " + err.Error())
}
}
if *flagSignBinary {
err := signFile(targetFileFull)
if err != nil {
fmt.Println("Unable to sign V2Ray binary: " + err.Error())
}
if v2rayOS == Windows {
err = signFile(filepath.Join(targetDir, "w"+targetFile))
if err != nil {
fmt.Println("Unable to sign V2Ray no console: " + err.Error())
}
}
}
err = copyConfigFiles(targetDir, v2rayOS)

4
tools/build/go.go

@ -7,9 +7,9 @@ import (
"time"
)
func buildV2Ray(targetFile string, version string, goOS GoOS, goArch GoArch) error {
func buildV2Ray(targetFile string, version string, goOS GoOS, goArch GoArch, extraLdFlags string) error {
goPath := os.Getenv("GOPATH")
ldFlags := "-s"
ldFlags := "-s " + extraLdFlags
if version != "custom" {
year, month, day := time.Now().UTC().Date()
today := fmt.Sprintf("%04d%02d%02d", year, int(month), day)

Loading…
Cancel
Save