mirror of
https://projects.blender.org/blender/blender.git
synced 2025-01-22 15:32:15 -05:00
Initial support of make format
for Windows
There are couple of caviats currently: - The script requires system-wide Python 3 available in the current search PATH as python.exe. This will get addressed soon by distributing unpacked Python binary in our libraries. - Since the libraries folder is to be known, this requires to have MSVC detected. Not too bad, since formatting is still way slower than detection, but still doesn't feel ideal.
This commit is contained in:
parent
f45b91a1c5
commit
fc32f98bbc
4 changed files with 21 additions and 3 deletions
10
build_files/windows/format.cmd
Normal file
10
build_files/windows/format.cmd
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
REM TODO(sergey): Switch to Python from libraries when available.
|
||||||
|
set PYTHON="python.exe"
|
||||||
|
set FORMAT_PATHS=%BLENDER_DIR%\source\tools\utils\clang_format_paths.py
|
||||||
|
|
||||||
|
REM The formatting script expects clang-format to be in the current PATH.
|
||||||
|
set PATH=%BUILD_VS_LIBDIR%\llvm\bin;%PATH%
|
||||||
|
|
||||||
|
%PYTHON% %FORMAT_PATHS% --expand-tabs
|
||||||
|
|
||||||
|
:EOF
|
|
@ -81,6 +81,8 @@ if NOT "%1" == "" (
|
||||||
set MUST_CLEAN=1
|
set MUST_CLEAN=1
|
||||||
) else if "%1" == "verbose" (
|
) else if "%1" == "verbose" (
|
||||||
set VERBOSE=1
|
set VERBOSE=1
|
||||||
|
) else if "%1" == "format" (
|
||||||
|
set FORMAT=1
|
||||||
) else (
|
) else (
|
||||||
echo Command "%1" unknown, aborting!
|
echo Command "%1" unknown, aborting!
|
||||||
exit /b 1
|
exit /b 1
|
||||||
|
|
|
@ -27,3 +27,4 @@ set CLANG_CMAKE_ARGS=
|
||||||
set ASAN_CMAKE_ARGS=
|
set ASAN_CMAKE_ARGS=
|
||||||
set WITH_PYDEBUG=
|
set WITH_PYDEBUG=
|
||||||
set PYDEBUG_CMAKE_ARGS=
|
set PYDEBUG_CMAKE_ARGS=
|
||||||
|
set FORMAT=
|
||||||
|
|
11
make.bat
11
make.bat
|
@ -47,13 +47,18 @@ if "%BUILD_VS_YEAR%" == "" (
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
call "%BLENDER_DIR%\build_files\windows\check_libraries.cmd"
|
||||||
|
if errorlevel 1 goto EOF
|
||||||
|
|
||||||
|
if "%FORMAT%" == "1" (
|
||||||
|
call "%BLENDER_DIR%\build_files\windows\format.cmd"
|
||||||
|
goto EOF
|
||||||
|
)
|
||||||
|
|
||||||
call "%BLENDER_DIR%\build_files\windows\set_build_dir.cmd"
|
call "%BLENDER_DIR%\build_files\windows\set_build_dir.cmd"
|
||||||
|
|
||||||
echo Building blender with VS%BUILD_VS_YEAR% for %BUILD_ARCH% in %BUILD_DIR%
|
echo Building blender with VS%BUILD_VS_YEAR% for %BUILD_ARCH% in %BUILD_DIR%
|
||||||
|
|
||||||
call "%BLENDER_DIR%\build_files\windows\check_libraries.cmd"
|
|
||||||
if errorlevel 1 goto EOF
|
|
||||||
|
|
||||||
call "%BLENDER_DIR%\build_files\windows\check_submodules.cmd"
|
call "%BLENDER_DIR%\build_files\windows\check_submodules.cmd"
|
||||||
if errorlevel 1 goto EOF
|
if errorlevel 1 goto EOF
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue