Changes between Version 3 and Version 4 of BuildingUsingMsvcBuildsystem
- Timestamp:
- 10/11/19 11:12:42 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BuildingUsingMsvcBuildsystem
v3 v4 1 1 [[TOC(inline, depth=1)]] 2 2 3 = Introduction=3 = Prerequisites = 4 4 5 MSVC buildsystem is a part of [https://github.com/OpenVPN/openvpn-build openvpn-build subproject] in [https://github.com/ GitHub]. It allows building OpenVPN and all it's dependencies on a Windows box with minimal dependencies. 5 - Visual Studio 2017 Community 6 - [http://strawberryperl.com/ Strawberry Perl] 6 7 7 = Setting up the build computer=8 = Build steps = 8 9 9 MSVC build was written with least dependencies in mind. You'll need only [http://www.activestate.com/activeperl Perl] and Visual Studio 2017 (Community or Professional). Once dependencies have been installed, launch Git Bash and follow [wiki:BuildingUsingGenericBuildsystem#Checkingoutopenvpn-buildrepository these instructions] to checkout [https://github.com/OpenVPN/openvpn-build openvpn-build] repository, which contains the MSVC buildsystem. 10 11 To customize the build options, refer to ''build-env.bat'', it contains the defaults for building, most settings can be customized by setting environment variable before executing the build script. You can also configure the build to use a Git repository or tarball of your liking, for example: 12 10 - Clone [https://github.com/OpenVPN/openvpn-build openvpn-build] repo: 13 11 {{{ 14 set GITHUB_USER=johndoe&& set OPENVPN_VERSION=vs2017&& build.bat12 c:\Users\Administrator\Projects>git clone git@github.com:OpenVPN/openvpn-build.git 15 13 }}} 16 14 17 18 = Building using MSVC buildsystem = 19 20 Descend to the ''openvpn-build/msvc'' directory and build: 21 15 - Clone [https://github.com/OpenVPN/openvpn openvpn] repo: 22 16 {{{ 23 > cd openvpn-build/msvc 24 > build.bat 17 c:\Users\Administrator\Projects>git clone git@github.com:OpenVPN/openvpn.git 25 18 }}} 26 19 27 This fetches all the dependencies, builds them and builds OpenVPN. 28 29 To build only dependencies: 30 20 - Build OpenVPN with dependencies: 31 21 {{{ 32 > set MODE=DEPS&&build.bat22 c:\Users\Administrator\Projects\openvpn-build\msvc\build.bat 33 23 }}} 34 24 35 To build only openvpn (assuming dependencies are already built): 36 25 - Development environment is ready. Open solution file in Visual Studio: 37 26 {{{ 38 > set MODE=OPENVPN&& build.bat 27 c:\Users\Administrator\Projects\openvpn\openvpn.sln 39 28 }}} 40 41 = Using Visual Studio IDE = 42 43 After command-line build you can use Visual Studio IDE - just open 44 45 {{{ 46 > openvpn-build\msvc\build.tmp\openvpn-<branch>\openvpn.sln 47 }}} 48 49 Note that by default build.bat builds dependencies for x64 architecture, so don't 50 forget to set "Solution Platforms" to "x64". 51 52 When running openvpn from IDE, you either need to copy dependencies (libeay32.dll etc) from 53 {{{ 54 > openvpn-build\msvc\image\bin 55 }}} 56 to 57 {{{ 58 > openvpn-build\msvc\build.tmp\openvpn-vs2017\x64-Output\Debug 59 }}} 60 or change "Working Directory" to openvpn-build\msvc\image\bin. 29 and start coding!