openvpn/msvc-build.bat
Lev Stipakov b70b2fc248 win: support for Visual Studio 2017
This patch enables building openvpn with Visual Studio 2017.

It is advised to use openvpn-build/msvs/build.bat which
also downloads and build required dependencies.

Changes made:

 - updated path to Visual Studio toolchain
 - updated platform toolset
 - added missing libraries
 - added x64 configurations
 - enabled AEAD ciphers to make NCP work
 - enabled unicode support
 - updated source files in project settings
 - fix includes
 - restored variable which was erroneously removed
 - added properties file which sets required env variables
 	(required to build with IDE)
 - etc

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Simon Rozman <simon@rozman.si>
Message-Id: <1538141209-32330-1-git-send-email-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17499.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2018-10-01 08:16:29 +02:00

51 lines
1.1 KiB
Batchfile

@echo off
rem Copyright (C) 2008-2012 Alon Bar-Lev <alon.barlev@gmail.com>
@rem this stupid command needed for SetEnv.cmd to operate
setlocal ENABLEDELAYEDEXPANSION
cd /d %0\..
call msvc-env.bat
set PLATFORMS=x64
set CONFIGURATIONS=Debug Release
if exist "%VCHOME%\vcvarsall.bat" (
call "%VCHOME%\vcvarsall.bat"
) else if exist "%VCHOME%\bin\vcvars32.bat" (
call "%VCHOME%\bin\vcvars32.bat"
) else if exist "%VCHOME%\Auxiliary\Build\vcvars32.bat" (
call "%VCHOME%\Auxiliary\Build\vcvars32.bat"
) else (
echo Cannot detect visual studio
goto error
)
msbuild /help > nul 2>&1
if errorlevel 1 set DO_VCBUILD=1
for %%p in (%PLATFORMS%) do (
for %%c in (%CONFIGURATIONS%) do (
rmdir /q /s %SOURCEBASE%\%%p\%%c > nul 2>&1
if "%DO_VCBUILD%" NEQ "" (
vcbuild /errfile:error.log /showenv "%SOLUTION%" /rebuild /platform:%%p "%%c|%%p"
for %%f in (error.log) do if %%~zf GTR 0 goto error
) else (
msbuild "%SOLUTION%" /p:Configuration="%%c" /p:Platform="%%p"
if errorlevel 1 goto error
)
)
)
exit /b 0
goto end
:error
exit /b 1
goto end
:end
endlocal