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