Changes between Version 2 and Version 3 of BuildingUsingMsvcBuildsystem


Ignore:
Timestamp:
10/01/18 08:01:50 (6 months ago)
Author:
stipa
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuildingUsingMsvcBuildsystem

    v2 v3  
    55MSVC 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.
    66
    7 '''NOTE:''' This buildsystem is not officially supported, and you're strongly encouraged to use the [wiki:BuildingUsingGenericBuildsystem cross-compile buildsystem] instead. If you really need to build OpenVPN using MSVC and encounter any issues, please send email to the [http://sourceforge.net/mail/?group_id=48978 openvpn-devel mailinglist].
    8 
    97= Setting up the build computer =
    108
    11 MSVC build was written with least dependencies in mind. You'll need only [http://www.activestate.com/activeperl Perl] and Visual Studio 2010 (Express). 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.
     9MSVC 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.
    1210
    1311To 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:
    1412
    1513{{{
    16 set OPENVPN_GIT=git://openvpn.git.sourceforge.net/gitroot/openvpn/openvpn.git
    17 set OPENVPN_SOURCE=git
    18 set OPENVPN_BRANCH=master
     14set GITHUB_USER=johndoe&& set OPENVPN_VERSION=vs2017&& build.bat
    1915}}}
    2016
     
    2218= Building using MSVC buildsystem =
    2319
    24 == Building everything ==
    25 
    2620Descend to the ''openvpn-build/msvc'' directory and build:
    2721
    2822{{{
    2923> cd openvpn-build/msvc
    30 > build
     24> build.bat
    3125}}}
    32 
    3326
    3427This fetches all the dependencies, builds them and builds OpenVPN.
    3528
    36 == Building dependencies only ==
    37 
    38 To build only dependencies (helpful for developers):
     29To build only dependencies:
    3930
    4031{{{
    41 > set DO_ONLY_DEPS=true
    42 > set TARGET=c:\Temp\build-deps
    43 > build
     32> set MODE=DEPS&& build.bat
    4433}}}
    4534
    46 == Build OpenVPN manually ==
    47 
    48 Provided you built the dependencies you can use the MSVC build system within OpenVPN tree, edit ''build-env-local.bat'' which is loaded by ''build.bat''. The variables defined in ''build-env-local.bat'' override the defaults given in ''build-env.bat''. For example, you can manually define the location of dependencies:
     35To build only openvpn (assuming dependencies are already built):
    4936
    5037{{{
    51 set OPENVPN_DEPROOT=c:\Temp\build-deps
     38> set MODE=OPENVPN&& build.bat
    5239}}}
    5340
    54 Then open IDE using:
     41= Using Visual Studio IDE =
     42
     43After command-line build you can use Visual Studio IDE - just open
    5544
    5645{{{
    57 > msvc-dev
     46> openvpn-build\msvc\build.tmp\openvpn-<branch>\openvpn.sln
    5847}}}
    5948
    60 Or build using:
     49Note that by default build.bat builds dependencies for x64 architecture, so don't
     50forget to set "Solution Platforms" to "x64".
    6151
     52When running openvpn from IDE, you either need to copy dependencies (libeay32.dll etc) from
    6253{{{
    63 > msvc-build
     54> openvpn-build\msvc\image\bin
    6455}}}
     56to
     57{{{
     58> openvpn-build\msvc\build.tmp\openvpn-vs2017\x64-Output\Debug
     59}}}
     60or change "Working Directory" to openvpn-build\msvc\image\bin.