-
Notifications
You must be signed in to change notification settings - Fork 267
/
BuildDependencies.bat
51 lines (40 loc) · 1.81 KB
/
BuildDependencies.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
@echo off
set currentDir=%~dp0
set publishDir=%currentDir%src\bin\win-x64\publish\
set publishDirBTI=%currentDir%src\bin\win-x64\BTI\publish\
set binDir=%currentDir%src\bin\
set resourcesDir=%binDir%Resources
if "%~1"=="publish" (
set resourcesDir=%publishDir%Resources
)
if "%~1"=="publish-BTI" (
set resourcesDir=%publishDirBTI%Resources
)
set buildParams=/p:PlatformToolset=v143 /p:Configuration=Release /p:OutDir=%resourcesDir% /clp:ErrorsOnly
set x86buildParams=%buildParams% /p:Platform=Win32
set x64buildParams=%buildParams% /p:Platform=x64
if "%~2" NEQ "gosrponly" (
echo compiling ProtonVPN.IPFilter.dll
msbuild src\ProtonVPN.IpFilter\ProtonVPN.IpFilter.vcxproj %x64buildParams% || exit /b %ERRORLEVEL%
echo compiling ProtonVPN.NetworkUtil.dll
msbuild src\ProtonVPN.NetworkUtil\ProtonVPN.NetworkUtil.vcxproj %x64buildParams% || exit /b %ERRORLEVEL%
echo compiling ProtonVPN.InstallActions.x86.dll
msbuild src\ProtonVPN.InstallActions\ProtonVPN.InstallActions.vcxproj %x86buildParams% || exit /b %ERRORLEVEL%
echo compiling ProtonVPN.InstallActions.dll
msbuild src\ProtonVPN.InstallActions\ProtonVPN.InstallActions.vcxproj %x64buildParams% || exit /b %ERRORLEVEL%
echo compiling LocalAgent.dll
pushd %currentDir%src\ProtonVPN.LocalAgent\localAgentWin
set GO111MODULE=off
set CGO_CFLAGS=-O3 -Wall -Wno-unused-function -Wno-switch -std=gnu11 -DWINVER=0x0601
go build -buildmode c-shared -ldflags="-w -s" -trimpath -v -o %resourcesDir%\LocalAgent.dll
if %ERRORLEVEL% equ 0 (
echo file saved %resourcesDir%\LocalAgent.dll
)
)
echo compiling GoSrp.dll
pushd %currentDir%src\srp\windows\cshared
set GO111MODULE=on
go build -buildmode=c-shared -v -ldflags="-s -w" -o %resourcesDir%\GoSrp.dll main.go
if %ERRORLEVEL% equ 0 (
echo file saved %resourcesDir%\GoSrp.dll
)