From 144b246a461b0d641a8bad70ed4d718813f43793 Mon Sep 17 00:00:00 2001 From: Netch Date: Sun, 12 Sep 2021 23:48:49 +0800 Subject: [PATCH] Build v2ray-core --- Other/v2ray-core/build.ps1 | 29 +++++++++++++++++++++++++++++ Other/v2ray-core/deps.ps1 | 0 2 files changed, 29 insertions(+) create mode 100644 Other/v2ray-core/build.ps1 create mode 100644 Other/v2ray-core/deps.ps1 diff --git a/Other/v2ray-core/build.ps1 b/Other/v2ray-core/build.ps1 new file mode 100644 index 00000000..d4935fc1 --- /dev/null +++ b/Other/v2ray-core/build.ps1 @@ -0,0 +1,29 @@ +Push-Location (Split-Path $MyInvocation.MyCommand.Path -Parent) + +git clone https://github.com/v2fly/v2ray-core -b 'v4.42.1' src +if ( -Not $? ) { + Pop-Location + exit $lastExitCode +} + +$Env:CGO_ENABLED='0' +$Env:GOROOT_FINAL='/usr' + +$Env:GOOS='windows' +$Env:GOARCH='amd64' +go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid=' -o '..\release\v2ray.exe' '.\src\main' +if ( -Not $? ) { + Pop-Location + exit $lastExitCode +} + +go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid=' -tags confonly -o '..\release\v2ctl.exe' '.\src\infra\control\main' +if ( -Not $? ) { + Pop-Location + exit $lastExitCode +} + +go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid= -H windowsgui' -o '..\release\wv2ray.exe' '.\src\main' + +Pop-Location +exit $lastExitCode \ No newline at end of file diff --git a/Other/v2ray-core/deps.ps1 b/Other/v2ray-core/deps.ps1 new file mode 100644 index 00000000..e69de29b