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/configure_msbuild.cmd | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 build_files/windows/configure_msbuild.cmd (limited to 'build_files/windows/configure_msbuild.cmd') diff --git a/build_files/windows/configure_msbuild.cmd b/build_files/windows/configure_msbuild.cmd new file mode 100644 index 00000000000..28884ce2fd7 --- /dev/null +++ b/build_files/windows/configure_msbuild.cmd @@ -0,0 +1,57 @@ +set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS% + +if "%BUILD_ARCH%"=="x64" ( + set MSBUILD_PLATFORM=x64 +) else if "%BUILD_ARCH%"=="x86" ( + set MSBUILD_PLATFORM=win32 +) + +if NOT EXIST %BUILD_DIR%\nul ( + mkdir %BUILD_DIR% +) + +if "%MUST_CLEAN%"=="1" ( + echo Cleaning %BUILD_DIR% + msbuild ^ + %BUILD_DIR%\Blender.sln ^ + /target:clean ^ + /property:Configuration=%BUILD_TYPE% ^ + /verbosity:minimal ^ + /p:platform=%MSBUILD_PLATFORM% +) + +if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1 +if "%NOBUILD%"=="1" set MUST_CONFIGURE=1 + +if "%MUST_CONFIGURE%"=="1" ( + + if NOT "%verbose%" == "" ( + echo %CMAKE% %BUILD_CMAKE_ARGS% -H%BLENDER_DIR% -B%BUILD_DIR% + ) + + cmake ^ + %BUILD_CMAKE_ARGS% ^ + -H%BLENDER_DIR% ^ + -B%BUILD_DIR% + + if %ERRORLEVEL% NEQ 0 ( + echo "Configuration Failed" + exit /b 1 + ) +) + +echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd +echo "%CMAKE%" . >> %BUILD_DIR%\rebuild.cmd +echo msbuild ^ + %BUILD_DIR%\Blender.sln ^ + /target:build ^ + /property:Configuration=%BUILD_TYPE% ^ + /maxcpucount:2 ^ + /verbosity:minimal ^ + /p:platform=%MSBUILD_PLATFORM% ^ + /flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log >> %BUILD_DIR%\rebuild.cmd +echo msbuild ^ + %BUILD_DIR%\INSTALL.vcxproj ^ + /property:Configuration=%BUILD_TYPE% ^ + /verbosity:minimal ^ + /p:platform=%MSBUILD_PLATFORM% >> %BUILD_DIR%\rebuild.cmd -- cgit v1.2.3