2015-12-31 13:14:49 -05:00
|
|
|
@echo off
|
|
|
|
REM This batch file does an out-of-source CMake build in ../build_windows
|
|
|
|
REM This is for users who like to configure & build Blender with a single command.
|
2017-04-23 12:10:57 -04:00
|
|
|
setlocal EnableDelayedExpansion
|
2016-01-01 09:42:43 -05:00
|
|
|
setlocal ENABLEEXTENSIONS
|
2015-12-31 13:14:49 -05:00
|
|
|
set BLENDER_DIR=%~dp0
|
2018-05-25 12:24:01 -04:00
|
|
|
|
2018-05-25 19:57:13 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\reset_variables.cmd"
|
2016-11-16 22:13:58 -05:00
|
|
|
|
2018-05-25 19:57:13 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\check_spaces_in_path.cmd"
|
|
|
|
if errorlevel 1 goto EOF
|
2017-01-19 15:55:50 -05:00
|
|
|
|
2018-05-25 19:57:13 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\parse_arguments.cmd" %*
|
|
|
|
if errorlevel 1 goto EOF
|
2017-01-19 15:55:50 -05:00
|
|
|
|
2022-01-25 11:19:03 -05:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\find_dependencies.cmd"
|
|
|
|
if errorlevel 1 goto EOF
|
|
|
|
|
2021-08-06 13:54:49 -04:00
|
|
|
REM if it is one of the convenience targets and BLENDER_BIN is set
|
2021-08-10 20:11:11 -04:00
|
|
|
REM skip compiler detection
|
2021-08-06 13:54:49 -04:00
|
|
|
if "%ICONS%%ICONS_GEOM%%DOC_PY%" == "1" (
|
|
|
|
if EXIST "%BLENDER_BIN%" (
|
|
|
|
goto convenience_targets
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2018-06-16 14:29:38 -04:00
|
|
|
if "%BUILD_SHOW_HASHES%" == "1" (
|
|
|
|
call "%BLENDER_DIR%\build_files\windows\show_hashes.cmd"
|
|
|
|
goto EOF
|
|
|
|
)
|
|
|
|
|
2018-05-25 19:57:13 -04:00
|
|
|
if "%SHOW_HELP%" == "1" (
|
|
|
|
call "%BLENDER_DIR%\build_files\windows\show_help.cmd"
|
2016-09-14 19:50:16 -04:00
|
|
|
goto EOF
|
|
|
|
)
|
2017-08-19 14:00:30 -04:00
|
|
|
|
2019-04-16 11:05:31 -04:00
|
|
|
if "%FORMAT%" == "1" (
|
|
|
|
call "%BLENDER_DIR%\build_files\windows\format.cmd"
|
|
|
|
goto EOF
|
|
|
|
)
|
|
|
|
|
2024-10-18 10:08:15 -04:00
|
|
|
if "%LICENSE%" == "1" (
|
|
|
|
call "%BLENDER_DIR%\build_files\windows\license.cmd"
|
|
|
|
goto EOF
|
|
|
|
)
|
|
|
|
|
2018-06-17 14:18:09 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\detect_architecture.cmd"
|
2019-08-05 12:31:51 -04:00
|
|
|
if errorlevel 1 goto EOF
|
2016-10-01 12:22:28 -04:00
|
|
|
|
2018-05-25 19:57:13 -04:00
|
|
|
if "%BUILD_VS_YEAR%" == "" (
|
|
|
|
call "%BLENDER_DIR%\build_files\windows\autodetect_msvc.cmd"
|
|
|
|
if errorlevel 1 (
|
|
|
|
echo Visual Studio not found ^(try with the 'verbose' switch for more information^)
|
|
|
|
goto EOF
|
2017-12-11 03:28:40 -05:00
|
|
|
)
|
2018-05-25 19:57:13 -04:00
|
|
|
) else (
|
|
|
|
call "%BLENDER_DIR%\build_files\windows\detect_msvc%BUILD_VS_YEAR%.cmd"
|
|
|
|
if errorlevel 1 (
|
|
|
|
echo Visual Studio %BUILD_VS_YEAR% not found ^(try with the 'verbose' switch for more information^)
|
2016-01-01 14:30:19 -05:00
|
|
|
goto EOF
|
|
|
|
)
|
2016-01-01 02:47:30 -05:00
|
|
|
)
|
2017-04-26 10:46:35 -04:00
|
|
|
|
2019-08-23 13:35:02 -04:00
|
|
|
if "%BUILD_UPDATE%" == "1" (
|
2022-10-21 11:50:14 -04:00
|
|
|
REM First see if the SVN libs are there and check them out if they are not.
|
2019-08-23 13:35:02 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\check_libraries.cmd"
|
|
|
|
if errorlevel 1 goto EOF
|
2022-10-29 13:25:33 -04:00
|
|
|
if "%BUILD_UPDATE_SVN%" == "1" (
|
|
|
|
REM Then update SVN platform libraries, since updating python while python is
|
|
|
|
REM running tends to be problematic. The python script that update_sources
|
|
|
|
REM calls later on may still try to switch branches and run into trouble,
|
2023-01-30 23:49:04 -05:00
|
|
|
REM but for *most* people this will side step the problem.
|
2024-02-22 07:50:55 -05:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\lib_update.cmd"
|
2022-10-29 13:25:33 -04:00
|
|
|
)
|
2022-10-21 11:50:14 -04:00
|
|
|
REM Finally call the python script shared between all platforms that updates git
|
|
|
|
REM and does any other SVN work like update the tests or branch switches
|
|
|
|
REM if required.
|
2019-08-23 13:35:02 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\update_sources.cmd"
|
|
|
|
goto EOF
|
|
|
|
)
|
|
|
|
|
2018-06-17 14:18:09 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\set_build_dir.cmd"
|
2015-12-31 13:14:49 -05:00
|
|
|
|
2021-08-06 13:54:49 -04:00
|
|
|
:convenience_targets
|
|
|
|
|
2021-08-04 21:32:24 -04:00
|
|
|
if "%ICONS_GEOM%" == "1" (
|
|
|
|
call "%BLENDER_DIR%\build_files\windows\icons_geom.cmd"
|
|
|
|
goto EOF
|
|
|
|
)
|
|
|
|
|
2021-08-06 13:54:49 -04:00
|
|
|
if "%DOC_PY%" == "1" (
|
|
|
|
call "%BLENDER_DIR%\build_files\windows\doc_py.cmd"
|
|
|
|
goto EOF
|
|
|
|
)
|
|
|
|
|
2022-01-25 11:19:03 -05:00
|
|
|
if "%CMAKE%" == "" (
|
|
|
|
echo Cmake not found in path, required for building, exiting...
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
|
2018-05-25 19:57:13 -04:00
|
|
|
echo Building blender with VS%BUILD_VS_YEAR% for %BUILD_ARCH% in %BUILD_DIR%
|
2016-01-01 00:04:21 -05:00
|
|
|
|
2019-04-16 11:05:31 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\check_libraries.cmd"
|
|
|
|
if errorlevel 1 goto EOF
|
|
|
|
|
2019-09-12 14:13:47 -04:00
|
|
|
if "%TEST%" == "1" (
|
|
|
|
call "%BLENDER_DIR%\build_files\windows\test.cmd"
|
|
|
|
goto EOF
|
|
|
|
)
|
|
|
|
|
2018-05-25 23:46:42 -04:00
|
|
|
if "%BUILD_WITH_NINJA%" == "" (
|
2018-06-17 14:18:09 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\configure_msbuild.cmd"
|
2018-05-25 23:46:42 -04:00
|
|
|
if errorlevel 1 goto EOF
|
2016-01-01 00:04:21 -05:00
|
|
|
|
2018-06-17 14:18:09 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\build_msbuild.cmd"
|
2018-05-25 23:46:42 -04:00
|
|
|
if errorlevel 1 goto EOF
|
|
|
|
) else (
|
2018-06-17 14:18:09 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\configure_ninja.cmd"
|
2018-05-25 23:46:42 -04:00
|
|
|
if errorlevel 1 goto EOF
|
|
|
|
|
2018-06-17 14:18:09 -04:00
|
|
|
call "%BLENDER_DIR%\build_files\windows\build_ninja.cmd"
|
2018-05-25 23:46:42 -04:00
|
|
|
if errorlevel 1 goto EOF
|
|
|
|
)
|
2015-12-31 13:14:49 -05:00
|
|
|
|
2018-06-17 14:18:09 -04:00
|
|
|
:EOF
|
2023-08-16 13:29:47 -04:00
|
|
|
if errorlevel 1 exit /b %errorlevel%
|