1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-04 17:27:23 -05:00

windows binary with subsystem window

This commit is contained in:
Darien Raymond 2017-02-23 17:59:22 +01:00
parent 21b6fa5217
commit 41a9aec10e
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 16 additions and 3 deletions

View File

@ -76,16 +76,29 @@ func build(targetOS, targetArch string, archive bool, version string, metadataFi
targetFile := getTargetFile(v2rayOS) targetFile := getTargetFile(v2rayOS)
targetFileFull := filepath.Join(targetDir, targetFile) targetFileFull := filepath.Join(targetDir, targetFile)
err = buildV2Ray(targetFileFull, version, v2rayOS, v2rayArch) err = buildV2Ray(targetFileFull, version, v2rayOS, v2rayArch, "")
if err != nil { if err != nil {
fmt.Println("Unable to build V2Ray: " + err.Error()) 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 { if *flagSignBinary {
err := signFile(targetFileFull) err := signFile(targetFileFull)
if err != nil { if err != nil {
fmt.Println("Unable to sign V2Ray binary: " + err.Error()) 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) err = copyConfigFiles(targetDir, v2rayOS)

View File

@ -7,9 +7,9 @@ import (
"time" "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") goPath := os.Getenv("GOPATH")
ldFlags := "-s" ldFlags := "-s " + extraLdFlags
if version != "custom" { if version != "custom" {
year, month, day := time.Now().UTC().Date() year, month, day := time.Now().UTC().Date()
today := fmt.Sprintf("%04d%02d%02d", year, int(month), day) today := fmt.Sprintf("%04d%02d%02d", year, int(month), day)