Changes between Version 3 and Version 4 of BuildingUsingMsvcBuildsystem


Ignore:
Timestamp:
10/11/19 11:12:42 (3 years ago)
Author:
lev stipakov
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuildingUsingMsvcBuildsystem

    v3 v4  
    11[[TOC(inline, depth=1)]]
    22
    3 = Introduction =
     3= Prerequisites =
    44
    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]
    67
    7 = Setting up the build computer =
     8= Build steps =
    89
    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:
    1311{{{
    14 set GITHUB_USER=johndoe&& set OPENVPN_VERSION=vs2017&& build.bat
     12  c:\Users\Administrator\Projects>git clone git@github.com:OpenVPN/openvpn-build.git
    1513}}}
    1614
    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:
    2216{{{
    23 > cd openvpn-build/msvc
    24 > build.bat
     17  c:\Users\Administrator\Projects>git clone git@github.com:OpenVPN/openvpn.git
    2518}}}
    2619
    27 This fetches all the dependencies, builds them and builds OpenVPN.
    28 
    29 To build only dependencies:
    30 
     20 - Build OpenVPN with dependencies:
    3121{{{
    32 > set MODE=DEPS&& build.bat
     22  c:\Users\Administrator\Projects\openvpn-build\msvc\build.bat
    3323}}}
    3424
    35 To build only openvpn (assuming dependencies are already built):
    36 
     25 - Development environment is ready. Open solution file in Visual Studio:
    3726{{{
    38 > set MODE=OPENVPN&& build.bat
     27  c:\Users\Administrator\Projects\openvpn\openvpn.sln
    3928}}}
    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!