2018-05-25 23:57:13 +00:00
|
|
|
set BUILD_DIR=%BLENDER_DIR%..\build_windows
|
|
|
|
set BUILD_TYPE=Release
|
|
|
|
:argv_loop
|
|
|
|
if NOT "%1" == "" (
|
|
|
|
|
|
|
|
REM Help Message
|
|
|
|
if "%1" == "help" (
|
|
|
|
set SHOW_HELP=1
|
|
|
|
goto EOF
|
|
|
|
)
|
|
|
|
REM Build Types
|
|
|
|
if "%1" == "debug" (
|
|
|
|
set BUILD_TYPE=Debug
|
|
|
|
REM Build Configurations
|
|
|
|
) else if "%1" == "builddir" (
|
|
|
|
set BUILD_DIR_OVERRRIDE="%BLENDER_DIR%..\%2"
|
|
|
|
shift /1
|
|
|
|
) else if "%1" == "with_tests" (
|
2019-05-13 20:08:27 +00:00
|
|
|
set TESTS_CMAKE_ARGS=%TESTS_CMAKE_ARGS% -DWITH_GTESTS=On
|
|
|
|
) else if "%1" == "with_opengl_tests" (
|
|
|
|
set TESTS_CMAKE_ARGS=%TESTS_CMAKE_ARGS% -DWITH_OPENGL_DRAW_TESTS=On -DWITH_OPENGL_RENDER_TESTS=On
|
2018-05-25 23:57:13 +00:00
|
|
|
) else if "%1" == "full" (
|
|
|
|
set TARGET=Full
|
|
|
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
|
|
|
|
-C"%BLENDER_DIR%\build_files\cmake\config\blender_full.cmake"
|
|
|
|
) else if "%1" == "lite" (
|
|
|
|
set TARGET=Lite
|
|
|
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_lite.cmake"
|
|
|
|
) else if "%1" == "cycles" (
|
|
|
|
set TARGET=Cycles
|
|
|
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\cycles_standalone.cmake"
|
|
|
|
) else if "%1" == "headless" (
|
|
|
|
set TARGET=Headless
|
|
|
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_headless.cmake"
|
|
|
|
) else if "%1" == "bpy" (
|
|
|
|
set TARGET=Bpy
|
|
|
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\bpy_module.cmake"
|
Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming
Things to note:
1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)
2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)
victor_cpu
msvc:3099.51
clang:2796.43
pavillon_barcelona_cpu
msvc:1872.05
clang:1827.72
koro_cpu
msvc:1097.58
clang:1006.51
fishy_cat_cpu
msvc:815.37
clang:722.2
classroom_cpu
msvc:1705.39
clang:1575.43
bmw27_cpu
msvc:552.38
clang:561.53
barbershop_interior_cpu
msvc:2134.93
clang:1922.33
3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.
4) X64 only currently, X86 builds but crashes on startup.
5) Tested with llvm/clang 6.0.0
6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration
7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.
8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.
9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3304
2018-05-28 20:34:47 +00:00
|
|
|
) else if "%1" == "clang" (
|
2018-05-29 01:56:17 +00:00
|
|
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
|
Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming
Things to note:
1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)
2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)
victor_cpu
msvc:3099.51
clang:2796.43
pavillon_barcelona_cpu
msvc:1872.05
clang:1827.72
koro_cpu
msvc:1097.58
clang:1006.51
fishy_cat_cpu
msvc:815.37
clang:722.2
classroom_cpu
msvc:1705.39
clang:1575.43
bmw27_cpu
msvc:552.38
clang:561.53
barbershop_interior_cpu
msvc:2134.93
clang:1922.33
3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.
4) X64 only currently, X86 builds but crashes on startup.
5) Tested with llvm/clang 6.0.0
6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration
7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.
8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.
9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3304
2018-05-28 20:34:47 +00:00
|
|
|
set WITH_CLANG=1
|
2018-05-25 23:57:13 +00:00
|
|
|
) else if "%1" == "release" (
|
2018-05-29 03:50:59 +00:00
|
|
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_release.cmake"
|
2018-05-25 23:57:13 +00:00
|
|
|
set TARGET=Release
|
2019-06-28 11:36:19 +00:00
|
|
|
) else if "%1" == "developer" (
|
|
|
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_developer.cmake"
|
2018-05-31 17:50:30 +00:00
|
|
|
) else if "%1" == "asan" (
|
|
|
|
set WITH_ASAN=1
|
2019-08-05 16:31:51 +00:00
|
|
|
) else if "%1" == "x86" (
|
|
|
|
echo Error: 32 bit builds of blender are no longer supported.
|
|
|
|
goto ERR
|
2018-05-25 23:57:13 +00:00
|
|
|
) else if "%1" == "x64" (
|
|
|
|
set BUILD_ARCH=x64
|
|
|
|
) else if "%1" == "2017" (
|
|
|
|
set BUILD_VS_YEAR=2017
|
|
|
|
) else if "%1" == "2017pre" (
|
|
|
|
set BUILD_VS_YEAR=2017
|
|
|
|
set VSWHERE_ARGS=-prerelease
|
2018-06-05 16:38:48 +00:00
|
|
|
) else if "%1" == "2017b" (
|
|
|
|
set BUILD_VS_YEAR=2017
|
|
|
|
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
|
2019-02-23 03:49:22 +00:00
|
|
|
) else if "%1" == "2019" (
|
|
|
|
set BUILD_VS_YEAR=2019
|
|
|
|
) else if "%1" == "2019pre" (
|
|
|
|
set BUILD_VS_YEAR=2019
|
|
|
|
set VSWHERE_ARGS=-prerelease
|
|
|
|
) else if "%1" == "2019b" (
|
|
|
|
set BUILD_VS_YEAR=2019
|
|
|
|
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
|
2018-05-25 23:57:13 +00:00
|
|
|
) else if "%1" == "2015" (
|
|
|
|
set BUILD_VS_YEAR=2015
|
|
|
|
) else if "%1" == "packagename" (
|
|
|
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DCPACK_OVERRIDE_PACKAGENAME="%2"
|
|
|
|
shift /1
|
|
|
|
) else if "%1" == "nobuild" (
|
|
|
|
set NOBUILD=1
|
2019-06-01 22:49:21 +00:00
|
|
|
) else if "%1" == "nobuildinfo" (
|
|
|
|
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_BUILDINFO=Off
|
2018-10-22 16:17:08 +00:00
|
|
|
) else if "%1" == "pydebug" (
|
|
|
|
set WITH_PYDEBUG=1
|
2018-05-25 23:57:13 +00:00
|
|
|
) else if "%1" == "showhash" (
|
|
|
|
SET BUILD_SHOW_HASHES=1
|
|
|
|
REM Non-Build Commands
|
|
|
|
) else if "%1" == "update" (
|
|
|
|
SET BUILD_UPDATE=1
|
2019-08-23 17:35:02 +00:00
|
|
|
set BUILD_UPDATE_ARGS=
|
2019-05-18 16:34:33 +00:00
|
|
|
) else if "%1" == "code_update" (
|
|
|
|
SET BUILD_UPDATE=1
|
2019-08-23 17:35:02 +00:00
|
|
|
set BUILD_UPDATE_ARGS="--only-code"
|
2018-05-25 23:57:13 +00:00
|
|
|
) else if "%1" == "ninja" (
|
|
|
|
SET BUILD_WITH_NINJA=1
|
|
|
|
) else if "%1" == "clean" (
|
|
|
|
set MUST_CLEAN=1
|
|
|
|
) else if "%1" == "verbose" (
|
|
|
|
set VERBOSE=1
|
2019-04-16 13:34:32 +00:00
|
|
|
) else if "%1" == "format" (
|
|
|
|
set FORMAT=1
|
2019-06-05 13:30:45 +00:00
|
|
|
set FORMAT_ARGS=%2 %3 %4 %5 %6 %7 %8 %9
|
|
|
|
goto EOF
|
2018-05-25 23:57:13 +00:00
|
|
|
) else (
|
|
|
|
echo Command "%1" unknown, aborting!
|
2019-08-05 16:31:51 +00:00
|
|
|
goto ERR
|
2018-05-25 23:57:13 +00:00
|
|
|
)
|
|
|
|
shift /1
|
|
|
|
goto argv_loop
|
|
|
|
)
|
|
|
|
:EOF
|
2019-08-05 16:31:51 +00:00
|
|
|
exit /b 0
|
|
|
|
:ERR
|
2019-08-23 17:35:02 +00:00
|
|
|
exit /b 1
|