1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-26 01:59:53 +03:00

Azure Pipelines: install OpenSSL and zlib through vcpkg on Windows

This commit also changes the x86 build so that it uses the "amd64_x86" toolchain, for potentially better build performance.

The architecture is now appended to the installers.
This commit is contained in:
Davide Beatrici 2020-07-27 23:34:34 +02:00
parent 60410accce
commit c865103795
2 changed files with 25 additions and 8 deletions

View File

@ -1,22 +1,35 @@
parameters:
- name: bits
- name: architecture
type: string
- name: vcpkgTriplet
type: string
- name: vcvarsPath
type: string
steps:
- task: Cache@2
inputs:
key: '"vcpkg-installed-windows-${{parameters.architecture}}"'
path: 'C:/vcpkg/installed'
displayName: 'Environment storage'
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars${{parameters.bits}}.bat"
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl $(Build.SourcesDirectory)
vcpkg install openssl zlib --triplet ${{parameters.vcpkgTriplet}}
workingDirectory: C:/vcpkg
displayName: 'Prepare environment'
- script: |
call "${{parameters.vcvarsPath}}"
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{parameters.vcpkgTriplet}} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl $(Build.SourcesDirectory)
cmake --build .
workingDirectory: $(Build.BinariesDirectory)
displayName: 'Build'
- script: |
mkdir "$(Build.StagingDirectory)/installers"
vpnsetup /SFXMODE:vpnclient /SFXOUT:"$(Build.StagingDirectory)/installers/softether-vpnclient-$(Build.SourceVersion).exe"
vpnsetup /SFXMODE:vpnserver_vpnbridge /SFXOUT:"$(Build.StagingDirectory)/installers/softether-vpnserver_vpnbridge-$(Build.SourceVersion).exe"
vpnsetup /SFXMODE:vpnclient /SFXOUT:"$(Build.StagingDirectory)/installers/softether-vpnclient-$(Build.SourceVersion)-${{parameters.architecture}}.exe"
vpnsetup /SFXMODE:vpnserver_vpnbridge /SFXOUT:"$(Build.StagingDirectory)/installers/softether-vpnserver_vpnbridge-$(Build.SourceVersion)-${{parameters.architecture}}.exe"
workingDirectory: $(Build.BinariesDirectory)
displayName: 'Build installers'
- powershell: |
. .ci\appveyor-vpntest.ps1
. .ci/appveyor-vpntest.ps1
displayName: 'Test'
- task: CopyFiles@2
inputs:

View File

@ -6,7 +6,9 @@ jobs:
steps:
- template: "azure-pipelines-win-steps.yml"
parameters:
bits: "64"
architecture: "x86_64"
vcpkgTriplet: "x64-windows-static-md"
vcvarsPath: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
- job: windows_x86
displayName: 'Windows (x86)'
pool:
@ -14,4 +16,6 @@ jobs:
steps:
- template: "azure-pipelines-win-steps.yml"
parameters:
bits: "32"
architecture: "x86"
vcpkgTriplet: "x86-windows-static-md"
vcvarsPath: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvarsamd64_x86.bat"