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