Version 2 (modified by Samuli Seppänen, 9 years ago) (diff)



MSVC buildsystem is a part of openvpn-build subproject in GitHub. It allows building OpenVPN and all it's dependencies on a Windows box with minimal dependencies.

NOTE: This buildsystem is not officially supported, and you're strongly encouraged to use the cross-compile buildsystem instead. If you really need to build OpenVPN using MSVC and encounter any issues, please send email to the openvpn-devel mailinglist.

Setting up the build computer

MSVC build was written with least dependencies in mind. You'll need only Perl and Visual Studio 2010 (Express). Once dependencies have been installed, launch Git Bash and follow these instructions to checkout openvpn-build repository, which contains the MSVC buildsystem.

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:

set OPENVPN_GIT=git://

Building using MSVC buildsystem

Building everything

Descend to the openvpn-build/msvc directory and build:

> cd openvpn-build/msvc
> build

This fetches all the dependencies, builds them and builds OpenVPN.

Building dependencies only

To build only dependencies (helpful for developers):

> set DO_ONLY_DEPS=true
> set TARGET=c:\Temp\build-deps
> build

Build OpenVPN manually

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:

set OPENVPN_DEPROOT=c:\Temp\build-deps

Then open IDE using:

> msvc-dev

Or build using:

> msvc-build