make.bat: Add support for building with ninja.
[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 :DetectionComplete
3 if NOT "%verbose%" == "" (
4         echo BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% 
5 )
6
7 if NOT EXIST %BUILD_DIR%\nul (
8         mkdir %BUILD_DIR%
9 )
10
11 if "%MUST_CLEAN%"=="1" (
12         echo Cleaning %BUILD_DIR%
13         cd %BUILD_DIR%
14         %CMAKE% cmake --build . --config Clean
15 )
16
17 if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
18 if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
19
20 if "%MUST_CONFIGURE%"=="1" (
21         cmake ^
22                 %BUILD_CMAKE_ARGS% ^
23                 -H%BLENDER_DIR% ^
24                 -B%BUILD_DIR% 
25
26         if %ERRORLEVEL% NEQ 0 (
27                 echo "Configuration Failed"
28                 exit /b 1
29         )
30 )
31
32 echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd
33 echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
34 echo ninja install >> %BUILD_DIR%\rebuild.cmd 
35 echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd