Setup TPM2-Plugin build environment
[aaf/sshsm.git] / SoftHSMv2 / testing / appveyor / appveyor_build.bat
1 setlocal
2
3 echo "Setting visual studio variables"
4
5 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %VCVARS_PLATFORM%
6 @echo on
7
8 echo "Setting PATH and other variables"
9 set cur_dir=%CD%
10 set PATH=%PATH%;%PYTHON_PATH%
11
12 echo %cur_dir%
13 cd win32
14
15 python Configure.py %CONFIGURE_OPTIONS% || goto :error
16
17 msbuild softhsm2.sln /p:Configuration="Release" /p:Platform="%MSBUILD_PLATFORM%" /p:PlatformToolset=v140 /target:Build || goto :error
18
19 cd %cur_dir%
20
21 IF "%ENV_PLATFORM%"=="x86" (set from_dir=%CD%\win32\Release) ELSE (set from_dir=%CD%\win32\x64\Release)
22
23 echo "Testing build"
24
25 cd %from_dir%
26 cryptotest.exe || goto :error
27 datamgrtest.exe || goto :error
28 handlemgrtest.exe || goto :error
29 objstoretest.exe || goto :error
30 p11test.exe || goto :error
31 sessionmgrtest.exe || goto :error
32 slotmgrtest.exe || goto :error
33
34 echo "Preparing output package"
35 copy %from_dir%\softhsm2.dll %RELEASE_DIR% || goto :error
36 copy %from_dir%\softhsm2-dump-file.exe %RELEASE_DIR% || goto :error
37 copy %from_dir%\softhsm2-keyconv.exe %RELEASE_DIR% || goto :error
38 copy %from_dir%\softhsm2-util.exe %RELEASE_DIR% || goto :error
39 copy %cur_dir%\src\lib\common\softhsm2.conf.in %RELEASE_DIR%\softhsm2.conf || goto :error
40
41 dir %RELEASE_DIR%
42
43 @echo *** BUILD SUCCESSFUL ***
44 endlocal
45 @exit /b 0
46
47
48 :error
49 @echo *** BUILD FAILED ***
50 endlocal
51 @exit /b 1