From 857e4e04d89f30727d60e16c7320a72718a76d1a Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Fri, 25 May 2018 17:57:13 -0600 Subject: make.bat: refactor make.bat make.bat was starting to become hard to maintain, this refactors it into separate batch files for each stage of the process. -Improved detection of msvc2013/2015 -Improved failure handling. -Added check for working msbuild and C++ compiler -Added verbose switch to ease trouble shooting. -Added Check if svn/cmake/git are in the path before using them -Display the build configuration before asking to download the libraries -Offer an option to recover an interrupted checkout of the libraries. -Automatically check out sub-modules in-case they are missing. --- build_files/windows/check_libraries.cmd | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 build_files/windows/check_libraries.cmd (limited to 'build_files/windows/check_libraries.cmd') diff --git a/build_files/windows/check_libraries.cmd b/build_files/windows/check_libraries.cmd new file mode 100644 index 00000000000..c8aad7c9adb --- /dev/null +++ b/build_files/windows/check_libraries.cmd @@ -0,0 +1,54 @@ +if "%BUILD_VS_YEAR%"=="2013" set BUILD_VS_LIBDIRPOST=vc12 +if "%BUILD_VS_YEAR%"=="2015" set BUILD_VS_LIBDIRPOST=vc14 +if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc14 + +if "%BUILD_ARCH%"=="x64" ( + set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST% +) else if "%BUILD_ARCH%"=="x86" ( + set BUILD_VS_SVNDIR=windows_%BUILD_VS_LIBDIRPOST% +) +set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%" + +if NOT "%verbose%" == "" ( + echo Library Directory = "%BUILD_VS_LIBDIR%" +) +if NOT EXIST %BUILD_VS_LIBDIR% ( + rem libs not found, but svn is on the system + echo + if not "%SVN%"=="" ( + echo. + echo The required external libraries in %BUILD_VS_LIBDIR% are missing + echo. + set /p GetLibs= "Would you like to download them? (y/n)" + if /I "!GetLibs!"=="Y" ( + echo. + echo Downloading %BUILD_VS_SVNDIR% libraries, please wait. + echo. +:RETRY + "%SVN%" checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/%BUILD_VS_SVNDIR% %BUILD_VS_LIBDIR% + if errorlevel 1 ( + set /p LibRetry= "Error during donwload, retry? y/n" + if /I "!LibRetry!"=="Y" ( + cd %BUILD_VS_LIBDIR% + "%SVN%" cleanup + cd %BLENDER_DIR% + goto RETRY + ) + echo. + echo Error: Download of external libraries failed. + echo This is needed for building, please manually run 'svn cleanup' and 'svn update' in + echo %BUILD_VS_LIBDIR% , until this is resolved you CANNOT make a successfull blender build + echo. + exit /b 1 + ) + ) + ) +) + +if NOT EXIST %BUILD_VS_LIBDIR% ( + echo. + echo Error: Required libraries not found at "%BUILD_VS_LIBDIR%" + echo This is needed for building, aborting! + echo. + exit /b 1 +) \ No newline at end of file -- cgit v1.2.3