10 | | C:\Temp>git clone https://github.com/OpenVPN/openvpn.git |
| 18 | # Installing Chocolatey |
| 19 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) |
| 20 | & choco.exe install -y git --params "/GitAndUnixToolsOnPath" |
| 21 | & choco.exe install -y python |
| 22 | & python.exe -m ensurepip |
| 23 | & python.exe -m pip install --upgrade pip |
| 24 | & python.exe -m pip install docutils |
| 25 | & choco.exe install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System' |
| 26 | & choco.exe install -y "visualstudio2022buildtools" |
| 27 | & choco.exe install -y "visualstudio2022-workload-vctools" --params "--add Microsoft.VisualStudio.Component.UWP.VC.ARM64 --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.Spectre --add Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre --add Microsoft.VisualStudio.Component.VC.ATL.ARM64.Spectre --add Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre --add Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre --add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre --quiet" |
| 28 | & choco.exe install -y windows-sdk-10-version-2004-windbg |
15 | | C:\Temp>git clone https://github.com/microsoft/vcpkg.git |
16 | | ... |
17 | | C:\Temp>cd vcpkg |
18 | | C:\Temp\vcpkg>bootstrap-vcpkg.bat |
19 | | ... |
20 | | C:\Temp\vcpkg>vcpkg integrate install |
| 40 | mkdir C:\OpenVPN |
| 41 | cd C:\OpenVPN |
| 42 | git clone https://github.com/microsoft/vcpkg.git |
| 43 | git clone https://github.com/OpenVPN/openvpn.git |
| 44 | set VCPKG_ROOT=C:\OpenVPN\vcpkg |
| 45 | cd openvpn |
| 46 | cmake --preset win-amd64-release |
| 47 | cmake --build --preset win-amd64-release |
| 48 | ctest --preset win-amd64-release |
23 | | * Build openvpn |
24 | | |
25 | | Now you could just open solution file {{{ openvpn.sln}}} in Visual Studio and build from there, or build from VS Developer Command Prompt: |
26 | | |
27 | | {{{ |
28 | | c:\Temp\openvpn>msbuild /p:Configuration=Release /p:Platform=x64 |
29 | | }}} |
30 | | |
31 | | Supported platforms are x64, ARM64 and Win32. |
| 51 | When using the presets, the build directory is |
| 52 | `out/build/<preset-name>/`, you can find the output files there. |
| 53 | No install support is provided directly in OpenVPN build, take a look |
| 54 | at https://github.com/OpenVPN/openvpn-build.git instead. |