From 94c8bbec9c820ad39f83e5c5e1f293b635e72124 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Sat, 8 Feb 2020 17:14:47 -0700 Subject: Windows: Improve rebuild.cmd Previously the MSVC environment was setup every time using vcvarsall.bat when you ran you ran rebuild.cmd, Generally not an issue but after many rebuilds on the same console, it grows the path environment variable beyond what is supported and building breaks. This patch adds a check to see if the environment is setup already and skips the call to vcvarsall.bat Also cleans up the double build in the msbuild's version of rebuild.cmd install.vcxproj will build all that is needed, so no need to do a regular build first. --- build_files/windows/configure_msbuild.cmd | 14 +++++--------- build_files/windows/configure_ninja.cmd | 5 ++++- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'build_files/windows') diff --git a/build_files/windows/configure_msbuild.cmd b/build_files/windows/configure_msbuild.cmd index 7cb0a4df689..3c1194011cd 100644 --- a/build_files/windows/configure_msbuild.cmd +++ b/build_files/windows/configure_msbuild.cmd @@ -59,21 +59,17 @@ if "%MUST_CONFIGURE%"=="1" ( exit /b 1 ) ) - -echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd +echo echo off > %BUILD_DIR%\rebuild.cmd +echo if "%%VSCMD_VER%%" == "" ^( >> %BUILD_DIR%\rebuild.cmd +echo call "%VCVARS%" %BUILD_ARCH% >> %BUILD_DIR%\rebuild.cmd +echo ^) >> %BUILD_DIR%\rebuild.cmd echo "%CMAKE%" . >> %BUILD_DIR%\rebuild.cmd echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd echo msbuild ^ - %BUILD_DIR%\Blender.sln ^ - /target:build ^ + %BUILD_DIR%\INSTALL.vcxproj ^ /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 echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd \ No newline at end of file diff --git a/build_files/windows/configure_ninja.cmd b/build_files/windows/configure_ninja.cmd index 8f766e855a6..1650e43cda9 100644 --- a/build_files/windows/configure_ninja.cmd +++ b/build_files/windows/configure_ninja.cmd @@ -80,7 +80,10 @@ if "%MUST_CONFIGURE%"=="1" ( ) ) -echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd +echo echo off > %BUILD_DIR%\rebuild.cmd +echo if "%%VSCMD_VER%%" == "" ^( >> %BUILD_DIR%\rebuild.cmd +echo call "%VCVARS%" %BUILD_ARCH% >> %BUILD_DIR%\rebuild.cmd +echo ^) >> %BUILD_DIR%\rebuild.cmd echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd echo ninja install >> %BUILD_DIR%\rebuild.cmd echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd \ No newline at end of file -- cgit v1.2.3