Initial support of `make format` for Windows
[blender.git] / make.bat
1 @echo off
2 REM This batch file does an out-of-source CMake build in ../build_windows
3 REM This is for users who like to configure & build Blender with a single command.
4 setlocal EnableDelayedExpansion
5 setlocal ENABLEEXTENSIONS
6 set BLENDER_DIR=%~dp0
7
8 call "%BLENDER_DIR%\build_files\windows\reset_variables.cmd"
9
10 call "%BLENDER_DIR%\build_files\windows\check_spaces_in_path.cmd"
11 if errorlevel 1 goto EOF
12
13 call "%BLENDER_DIR%\build_files\windows\parse_arguments.cmd" %*
14 if errorlevel 1 goto EOF
15
16 call "%BLENDER_DIR%\build_files\windows\find_dependencies.cmd"
17 if errorlevel 1 goto EOF
18
19 if "%BUILD_SHOW_HASHES%" == "1" (
20         call "%BLENDER_DIR%\build_files\windows\show_hashes.cmd"
21         goto EOF
22 )
23
24 if "%SHOW_HELP%" == "1" (
25         call "%BLENDER_DIR%\build_files\windows\show_help.cmd"
26         goto EOF
27 )
28
29 if "%BUILD_UPDATE%" == "1" (
30         call "%BLENDER_DIR%\build_files\windows\update_sources.cmd"
31         goto EOF
32 )
33
34 call "%BLENDER_DIR%\build_files\windows\detect_architecture.cmd"
35
36 if "%BUILD_VS_YEAR%" == "" (
37         call "%BLENDER_DIR%\build_files\windows\autodetect_msvc.cmd"
38         if errorlevel 1 (
39                 echo Visual Studio not found ^(try with the 'verbose' switch for more information^)
40                 goto EOF
41         )
42 ) else (
43         call "%BLENDER_DIR%\build_files\windows\detect_msvc%BUILD_VS_YEAR%.cmd"
44         if errorlevel 1 (
45                 echo Visual Studio %BUILD_VS_YEAR% not found ^(try with the 'verbose' switch for more information^)
46                 goto EOF
47         )
48 )
49
50 call "%BLENDER_DIR%\build_files\windows\check_libraries.cmd"
51 if errorlevel 1 goto EOF
52
53 if "%FORMAT%" == "1" (
54         call "%BLENDER_DIR%\build_files\windows\format.cmd"
55         goto EOF
56 )
57
58 call "%BLENDER_DIR%\build_files\windows\set_build_dir.cmd"
59
60 echo Building blender with VS%BUILD_VS_YEAR% for %BUILD_ARCH% in %BUILD_DIR%
61
62 call "%BLENDER_DIR%\build_files\windows\check_submodules.cmd"
63 if errorlevel 1 goto EOF
64
65 if "%BUILD_WITH_NINJA%" == "" (
66         call "%BLENDER_DIR%\build_files\windows\configure_msbuild.cmd"
67         if errorlevel 1 goto EOF
68
69         call "%BLENDER_DIR%\build_files\windows\build_msbuild.cmd"
70         if errorlevel 1 goto EOF
71 ) else (
72         call "%BLENDER_DIR%\build_files\windows\configure_ninja.cmd"
73         if errorlevel 1 goto EOF
74
75         call "%BLENDER_DIR%\build_files\windows\build_ninja.cmd"
76         if errorlevel 1 goto EOF
77 )
78
79 :EOF