Sculpt: Split Box Mask into its own operator
[blender.git] / build_files / windows / configure_msbuild.cmd
1 set BUILD_GENERATOR_POST=
2 set BUILD_PLATFORM_SELECT=
3 set MSBUILD_PLATFORM=x64
4
5 if "%BUILD_WITH_SCCACHE%"=="1" (
6                 echo sccache is only supported with ninja as the build system. 
7                 exit /b 1 
8 )
9
10 if "%WITH_CLANG%"=="1" (
11         set CLANG_CMAKE_ARGS=-T"llvm"
12         if "%WITH_ASAN%"=="1" (
13                 set ASAN_CMAKE_ARGS=-DWITH_COMPILER_ASAN=On
14         )
15 ) else (
16         if "%WITH_ASAN%"=="1" (
17                 echo ASAN is only supported with clang.
18                 exit /b 1 
19         )
20 )
21
22 if "%WITH_PYDEBUG%"=="1" (
23         set PYDEBUG_CMAKE_ARGS=-DWINDOWS_PYTHON_DEBUG=On
24 )
25
26 if "%BUILD_VS_YEAR%"=="2019" (
27         set BUILD_PLATFORM_SELECT=-A %MSBUILD_PLATFORM%
28 ) else (
29         set BUILD_GENERATOR_POST=%WINDOWS_ARCH%
30 )
31
32 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%BUILD_GENERATOR_POST%" %BUILD_PLATFORM_SELECT% %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
33
34 if NOT EXIST %BUILD_DIR%\nul (
35         mkdir %BUILD_DIR%
36 )
37
38 if "%MUST_CLEAN%"=="1" (
39         echo Cleaning %BUILD_DIR%
40         msbuild ^
41                 %BUILD_DIR%\Blender.sln ^
42                 /target:clean ^
43                 /property:Configuration=%BUILD_TYPE% ^
44                 /verbosity:minimal ^
45                 /p:platform=%MSBUILD_PLATFORM%
46 )
47
48 if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
49 if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
50
51 if "%MUST_CONFIGURE%"=="1" (
52
53         if NOT "%verbose%" == "" (
54                 echo "%CMAKE% %BUILD_CMAKE_ARGS% -H%BLENDER_DIR% -B%BUILD_DIR%"
55         )
56
57         cmake ^
58                 %BUILD_CMAKE_ARGS% ^
59                 -H%BLENDER_DIR% ^
60                 -B%BUILD_DIR% 
61         
62         if errorlevel 1 (
63                 echo "Configuration Failed"
64                 exit /b 1
65         )
66 )
67 echo echo off > %BUILD_DIR%\rebuild.cmd
68 echo if "%%VSCMD_VER%%" == "" ^( >> %BUILD_DIR%\rebuild.cmd
69 echo   call "%VCVARS%" %BUILD_ARCH% >> %BUILD_DIR%\rebuild.cmd
70 echo ^) >> %BUILD_DIR%\rebuild.cmd
71 echo "%CMAKE%" . >> %BUILD_DIR%\rebuild.cmd
72 echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
73 echo msbuild ^
74         %BUILD_DIR%\INSTALL.vcxproj ^
75         /property:Configuration=%BUILD_TYPE% ^
76         /maxcpucount:2 ^
77         /verbosity:minimal ^
78         /p:platform=%MSBUILD_PLATFORM% ^
79         /flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log >> %BUILD_DIR%\rebuild.cmd
80 echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd