Cleanup: Fix naming of a function
[blender.git] / build_files / windows / parse_arguments.cmd
1 set BUILD_DIR=%BLENDER_DIR%..\build_windows
2 set BUILD_TYPE=Release
3 :argv_loop
4 if NOT "%1" == "" (
5
6         REM Help Message
7         if "%1" == "help" (
8                 set SHOW_HELP=1
9                 goto EOF
10         )
11         REM Build Types
12         if "%1" == "debug" (
13                 set BUILD_TYPE=Debug
14         REM Build Configurations
15         ) else if "%1" == "builddir" (
16                 set BUILD_DIR_OVERRRIDE=%BLENDER_DIR%..\%2
17                 shift /1
18         ) else if "%1" == "with_tests" (
19                 set TESTS_CMAKE_ARGS=%TESTS_CMAKE_ARGS% -DWITH_GTESTS=On
20         ) else if "%1" == "with_opengl_tests" (
21                 set TESTS_CMAKE_ARGS=%TESTS_CMAKE_ARGS% -DWITH_OPENGL_DRAW_TESTS=On -DWITH_OPENGL_RENDER_TESTS=On
22         ) else if "%1" == "full" (
23                 set TARGET=Full
24                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
25                     -C"%BLENDER_DIR%\build_files\cmake\config\blender_full.cmake"
26         ) else if "%1" == "lite" (
27                 set TARGET=Lite
28                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_lite.cmake"
29         ) else if "%1" == "cycles" (
30                 set TARGET=Cycles
31                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\cycles_standalone.cmake"
32         ) else if "%1" == "headless" (
33                 set TARGET=Headless
34                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_headless.cmake"
35         ) else if "%1" == "bpy" (
36                 set TARGET=Bpy
37                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\bpy_module.cmake"
38         ) else if "%1" == "clang" (
39                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
40                 set WITH_CLANG=1
41         ) else if "%1" == "release" (
42                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_release.cmake"
43                 set TARGET=Release
44         ) else if "%1" == "developer" (
45                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_developer.cmake"
46         ) else if "%1" == "asan" (
47                 set WITH_ASAN=1
48         ) else if "%1" == "x86" ( 
49                 echo Error: 32 bit builds of blender are no longer supported.
50                 goto ERR
51         ) else if "%1" == "x64" (
52                 set BUILD_ARCH=x64
53         ) else if "%1" == "2017" (
54                 set BUILD_VS_YEAR=2017
55         ) else if "%1" == "2017pre" (
56                 set BUILD_VS_YEAR=2017
57                 set VSWHERE_ARGS=-prerelease
58         ) else if "%1" == "2017b" (
59                 set BUILD_VS_YEAR=2017
60                 set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
61         ) else if "%1" == "2019" (
62                 set BUILD_VS_YEAR=2019
63         ) else if "%1" == "2019pre" (
64                 set BUILD_VS_YEAR=2019
65                 set VSWHERE_ARGS=-prerelease
66         ) else if "%1" == "2019b" (
67                 set BUILD_VS_YEAR=2019
68                 set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
69         ) else if "%1" == "2015" (
70                 set BUILD_VS_YEAR=2015
71         ) else if "%1" == "packagename" (
72                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DCPACK_OVERRIDE_PACKAGENAME="%2"
73                 shift /1
74         ) else if "%1" == "nobuild" (
75                 set NOBUILD=1
76         ) else if "%1" == "nobuildinfo" (
77                 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_BUILDINFO=Off
78         ) else if "%1" == "pydebug" (
79                 set WITH_PYDEBUG=1
80         ) else if "%1" == "showhash" (
81                 SET BUILD_SHOW_HASHES=1
82         REM Non-Build Commands
83         ) else if "%1" == "update" (
84                 SET BUILD_UPDATE=1
85                 set BUILD_UPDATE_ARGS=
86         ) else if "%1" == "code_update" (
87                 SET BUILD_UPDATE=1
88                 set BUILD_UPDATE_ARGS="--no-libraries"
89         ) else if "%1" == "ninja" (
90                 SET BUILD_WITH_NINJA=1
91         ) else if "%1" == "clean" (
92                 set MUST_CLEAN=1
93         ) else if "%1" == "verbose" (
94                 set VERBOSE=1
95         ) else if "%1" == "test" (
96                 set TEST=1
97                 set NOBUILD=1
98         ) else if "%1" == "format" (
99                 set FORMAT=1
100                 set FORMAT_ARGS=%2 %3 %4 %5 %6 %7 %8 %9
101                 goto EOF
102         ) else (
103                 echo Command "%1" unknown, aborting!
104                 goto ERR
105         )
106         shift /1
107         goto argv_loop
108 )
109 :EOF
110 exit /b 0
111 :ERR
112 exit /b 1