Merge remote-tracking branch 'origin/master' into blender2.8
[blender.git] / build_files / windows / configure_ninja.cmd
1 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
2
3 if "%WITH_CLANG%" == "1" (
4         echo Building with ninja and clang not supported yet.
5         exit /b 1
6 )
7
8 :DetectionComplete
9 if NOT "%verbose%" == "" (
10         echo BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% 
11 )
12
13 if NOT EXIST %BUILD_DIR%\nul (
14         mkdir %BUILD_DIR%
15 )
16
17 if "%MUST_CLEAN%"=="1" (
18         echo Cleaning %BUILD_DIR%
19         cd %BUILD_DIR%
20         %CMAKE% cmake --build . --config Clean
21 )
22
23 if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
24 if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
25
26 if "%MUST_CONFIGURE%"=="1" (
27         cmake ^
28                 %BUILD_CMAKE_ARGS% ^
29                 -H%BLENDER_DIR% ^
30                 -B%BUILD_DIR% 
31
32         if %ERRORLEVEL% NEQ 0 (
33                 echo "Configuration Failed"
34                 exit /b 1
35         )
36 )
37
38 echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd
39 echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
40 echo ninja install >> %BUILD_DIR%\rebuild.cmd 
41 echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd