]> git.sesse.net Git - casparcg/blob - build-scripts/build-windows.bat
Include CEF .pak files in builds
[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\RelWithDebInfo\libcef.dll.pdb "%SERVER_FOLDER%\Server" || goto :error
49 copy shell\casparcg.config "%SERVER_FOLDER%\Server" || goto :error
50 copy shell\*.ttf "%SERVER_FOLDER%\Server" || goto :error
51 copy shell\*.pak "%SERVER_FOLDER%\Server" || goto :error
52 xcopy shell\locales "%SERVER_FOLDER%\Server\locales" /E /I /Y || goto :error
53
54 :: Copy documentation
55 echo Copying documentation...
56 copy ..\CHANGELOG "%SERVER_FOLDER%" || goto :error
57 copy ..\LICENSE "%SERVER_FOLDER%" || goto :error
58 copy ..\README "%SERVER_FOLDER%" || goto :error
59
60 :: Create zip file
61 echo Creating zip...
62 "%BUILD_7ZIP%" a "%BUILD_ARCHIVE_NAME%.7z" "%SERVER_FOLDER%" || goto :error
63
64 :: Skip exiting with failure
65 goto :EOF
66
67 :error
68 exit /b %errorlevel%