make.bat: Preliminary Visual Studio 2019 support.
[blender.git] / build_files / windows / check_libraries.cmd
1 if "%BUILD_VS_YEAR%"=="2015" set BUILD_VS_LIBDIRPOST=vc14
2 if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc14
3 if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc14
4
5 if "%BUILD_ARCH%"=="x64" (
6         set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
7 ) else if "%BUILD_ARCH%"=="x86" (
8         set BUILD_VS_SVNDIR=windows_%BUILD_VS_LIBDIRPOST%
9 )
10 set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
11
12 if NOT "%verbose%" == "" (
13         echo Library Directory = "%BUILD_VS_LIBDIR%"
14 )
15 if NOT EXIST %BUILD_VS_LIBDIR% (
16         rem libs not found, but svn is on the system
17         echo 
18         if not "%SVN%"=="" (
19                 echo.
20                 echo The required external libraries in %BUILD_VS_LIBDIR% are missing
21                 echo.
22                 set /p GetLibs= "Would you like to download them? (y/n)"
23                 if /I "!GetLibs!"=="Y" (
24                         echo.
25                         echo Downloading %BUILD_VS_SVNDIR% libraries, please wait.
26                         echo.
27 :RETRY                  
28                         "%SVN%" checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/%BUILD_VS_SVNDIR% %BUILD_VS_LIBDIR%
29                         if errorlevel 1 (
30                                 set /p LibRetry= "Error during download, retry? y/n"
31                                 if /I "!LibRetry!"=="Y" (
32                                         cd %BUILD_VS_LIBDIR%
33                                         "%SVN%" cleanup 
34                                         cd %BLENDER_DIR%
35                                         goto RETRY
36                                 )
37                                 echo.
38                                 echo Error: Download of external libraries failed. 
39                                 echo This is needed for building, please manually run 'svn cleanup' and 'svn update' in
40                                 echo %BUILD_VS_LIBDIR% , until this is resolved you CANNOT make a successful blender build
41                                 echo.
42                                 exit /b 1
43                         )
44                 )
45         )
46 )
47
48 if NOT EXIST %BUILD_VS_LIBDIR% (
49         echo.
50         echo Error: Required libraries not found at "%BUILD_VS_LIBDIR%"
51         echo This is needed for building, aborting!
52         echo.
53         exit /b 1
54 )