]> git.sesse.net Git - casparcg/blob - build-scripts/build-windows.bat
[CEF] excluded libcef.pdb from Windows build to be able to change back to .zip format...
[casparcg] / build-scripts / build-windows.bat
1 @echo off
2
3 :: Fail early if environment not set
4 if not defined BUILD_VCVARSALL exit /b 1
5 if not defined BUILD_ARCHIVE_NAME exit /b 1
6 if not defined BUILD_PARALLEL_THREADS exit /b 1
7 if not defined BUILD_7ZIP exit /b 1
8
9 :: Clean and enter shadow build folder
10 echo Cleaning...
11 cd .. || goto :error
12 if exist build rmdir build /s /q || goto :error
13 mkdir build || goto :error
14
15 :: Unpack archived dependencies
16 echo Unpacking archived dependencies...
17 "%BUILD_7ZIP%" x -y -odependencies64 dependencies64\large_files_win32.7z || goto :error
18
19 :: Setup VC++ environment
20 echo Setting up VC++...
21 call "%BUILD_VCVARSALL%" amd64 || goto :error
22
23 :: Run cmake
24 cd build || goto :error
25 cmake -G "Visual Studio 14 2015" -A x64 .. || goto :error
26
27 :: Build with MSBuild
28 echo Building...
29 msbuild "CasparCG Server.sln" /t:Clean /p:Configuration=RelWithDebInfo || goto :error
30 msbuild "CasparCG Server.sln" /p:Configuration=RelWithDebInfo /m:%BUILD_PARALLEL_THREADS% || goto :error
31
32 :: Create server folder to later zip
33 set SERVER_FOLDER=CasparCG Server
34 if exist "%SERVER_FOLDER%" rmdir "%SERVER_FOLDER%" /s /q || goto :error
35 mkdir "%SERVER_FOLDER%" || goto :error
36
37 :: Copy media files
38 echo Copying media...
39 xcopy ..\deploy\general\Server "%SERVER_FOLDER%\Server" /E /I /Y || goto :error
40 xcopy ..\deploy\general\Wallpapers "%SERVER_FOLDER%\Wallpapers" /E /I /Y || goto :error
41 copy ..\deploy\general\CasparCG_Server_2.0-brochure.pdf "%SERVER_FOLDER%" || goto :error
42
43 :: Copy binaries
44 echo Copying binaries...
45 copy shell\*.dll "%SERVER_FOLDER%\Server" || goto :error
46 copy shell\RelWithDebInfo\casparcg.exe "%SERVER_FOLDER%\Server" || goto :error
47 copy shell\RelWithDebInfo\casparcg.pdb "%SERVER_FOLDER%\Server" || goto :error
48 copy shell\casparcg.config "%SERVER_FOLDER%\Server" || goto :error
49 copy shell\*.ttf "%SERVER_FOLDER%\Server" || goto :error
50 copy shell\*.pak "%SERVER_FOLDER%\Server" || goto :error
51 xcopy shell\locales "%SERVER_FOLDER%\Server\locales" /E /I /Y || goto :error
52
53 :: Copy documentation
54 echo Copying documentation...
55 copy ..\CHANGELOG "%SERVER_FOLDER%" || goto :error
56 copy ..\LICENSE "%SERVER_FOLDER%" || goto :error
57 copy ..\README "%SERVER_FOLDER%" || goto :error
58
59 :: Create zip file
60 echo Creating zip...
61 "%BUILD_7ZIP%" a "%BUILD_ARCHIVE_NAME%.zip" "%SERVER_FOLDER%" || goto :error
62
63 :: Skip exiting with failure
64 goto :EOF
65
66 :error
67 exit /b %errorlevel%