forked from bartvdbraak/blender
make.bat: unify python detection
Several sub commands tried on their own to locate python, given I wanted to look in several locations for a broader libdir compatibility this is best done in a central location. Python 3.9 is still preferred, but if 3.10-3.12 are available that be accepted as well. note: this is about the python version make.bat uses to run various python helper scripts, this change has no influence on the python version blender itself uses.
This commit is contained in:
parent
c813a1b358
commit
f26c36c96b
@ -3,7 +3,32 @@ for %%X in (svn.exe) do (set SVN=%%~$PATH:X)
|
|||||||
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
|
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
|
||||||
for %%X in (ctest.exe) do (set CTEST=%%~$PATH:X)
|
for %%X in (ctest.exe) do (set CTEST=%%~$PATH:X)
|
||||||
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
|
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
|
||||||
|
REM For python, default on 39 but if that does not exist also check
|
||||||
|
REM the 310,311 and 312 folders to see if those are there, it checks
|
||||||
|
REM this far ahead to ensure good lib folder compatiblity in the future.
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\310\bin\python.exe
|
||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\311\bin\python.exe
|
||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\312\bin\python.exe
|
||||||
|
if EXIST %PYTHON% (
|
||||||
|
goto detect_python_done
|
||||||
|
)
|
||||||
|
|
||||||
|
if NOT EXIST %PYTHON% (
|
||||||
|
echo Warning: Python not found, there is likely an issue with the library folder
|
||||||
|
set PYTHON=""
|
||||||
|
)
|
||||||
|
|
||||||
|
:detect_python_done
|
||||||
if NOT "%verbose%" == "" (
|
if NOT "%verbose%" == "" (
|
||||||
echo svn : "%SVN%"
|
echo svn : "%SVN%"
|
||||||
echo cmake : "%CMAKE%"
|
echo cmake : "%CMAKE%"
|
||||||
@ -11,7 +36,3 @@ if NOT "%verbose%" == "" (
|
|||||||
echo git : "%GIT%"
|
echo git : "%GIT%"
|
||||||
echo python : "%PYTHON%"
|
echo python : "%PYTHON%"
|
||||||
)
|
)
|
||||||
if "%CMAKE%" == "" (
|
|
||||||
echo Cmake not found in path, required for building, exiting...
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
@ -9,17 +9,11 @@ exit /b 1
|
|||||||
:detect_done
|
:detect_done
|
||||||
echo found clang-format in %CF_PATH%
|
echo found clang-format in %CF_PATH%
|
||||||
|
|
||||||
if EXIST %PYTHON% (
|
if NOT EXIST %PYTHON% (
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
echo python not found, required for this operation
|
||||||
goto detect_python_done
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
echo python not found in lib folder
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:detect_python_done
|
|
||||||
echo found python (%PYTHON%)
|
|
||||||
|
|
||||||
set FORMAT_PATHS=%BLENDER_DIR%\source\tools\utils_maintenance\clang_format_paths.py
|
set FORMAT_PATHS=%BLENDER_DIR%\source\tools\utils_maintenance\clang_format_paths.py
|
||||||
|
|
||||||
REM The formatting script expects clang-format to be in the current PATH.
|
REM The formatting script expects clang-format to be in the current PATH.
|
||||||
|
@ -1,18 +1,8 @@
|
|||||||
if EXIST "%PYTHON%" (
|
if NOT EXIST %PYTHON% (
|
||||||
goto detect_python_done
|
echo python not found, required for this operation
|
||||||
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
|
||||||
if EXIST %PYTHON% (
|
|
||||||
goto detect_python_done
|
|
||||||
)
|
|
||||||
|
|
||||||
echo python not found at %PYTHON%
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:detect_python_done
|
|
||||||
echo found python (%PYTHON%)
|
|
||||||
|
|
||||||
call "%~dp0\find_inkscape.cmd"
|
call "%~dp0\find_inkscape.cmd"
|
||||||
|
|
||||||
if EXIST "%INKSCAPE_BIN%" (
|
if EXIST "%INKSCAPE_BIN%" (
|
||||||
|
@ -1,18 +1,8 @@
|
|||||||
if EXIST %PYTHON% (
|
if NOT EXIST %PYTHON% (
|
||||||
goto detect_python_done
|
echo python not found, required for this operation
|
||||||
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\39\bin\python.exe
|
|
||||||
if EXIST %PYTHON% (
|
|
||||||
goto detect_python_done
|
|
||||||
)
|
|
||||||
|
|
||||||
echo python not found at %PYTHON%
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:detect_python_done
|
|
||||||
echo found python (%PYTHON%)
|
|
||||||
|
|
||||||
call "%~dp0\find_blender.cmd"
|
call "%~dp0\find_blender.cmd"
|
||||||
|
|
||||||
if EXIST "%BLENDER_BIN%" (
|
if EXIST "%BLENDER_BIN%" (
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
if EXIST %PYTHON% (
|
if NOT EXIST %PYTHON% (
|
||||||
goto detect_python_done
|
echo python not found, required for this operation
|
||||||
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
echo python not found in lib folder
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:detect_python_done
|
:detect_python_done
|
||||||
|
|
||||||
REM Use -B to avoid writing __pycache__ in lib directory and causing update conflicts.
|
REM Use -B to avoid writing __pycache__ in lib directory and causing update conflicts.
|
||||||
|
11
make.bat
11
make.bat
@ -13,6 +13,9 @@ if errorlevel 1 goto EOF
|
|||||||
call "%BLENDER_DIR%\build_files\windows\parse_arguments.cmd" %*
|
call "%BLENDER_DIR%\build_files\windows\parse_arguments.cmd" %*
|
||||||
if errorlevel 1 goto EOF
|
if errorlevel 1 goto EOF
|
||||||
|
|
||||||
|
call "%BLENDER_DIR%\build_files\windows\find_dependencies.cmd"
|
||||||
|
if errorlevel 1 goto EOF
|
||||||
|
|
||||||
REM if it is one of the convenience targets and BLENDER_BIN is set
|
REM if it is one of the convenience targets and BLENDER_BIN is set
|
||||||
REM skip compiler detection
|
REM skip compiler detection
|
||||||
if "%ICONS%%ICONS_GEOM%%DOC_PY%" == "1" (
|
if "%ICONS%%ICONS_GEOM%%DOC_PY%" == "1" (
|
||||||
@ -21,9 +24,6 @@ if "%ICONS%%ICONS_GEOM%%DOC_PY%" == "1" (
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
call "%BLENDER_DIR%\build_files\windows\find_dependencies.cmd"
|
|
||||||
if errorlevel 1 goto EOF
|
|
||||||
|
|
||||||
if "%BUILD_SHOW_HASHES%" == "1" (
|
if "%BUILD_SHOW_HASHES%" == "1" (
|
||||||
call "%BLENDER_DIR%\build_files\windows\show_hashes.cmd"
|
call "%BLENDER_DIR%\build_files\windows\show_hashes.cmd"
|
||||||
goto EOF
|
goto EOF
|
||||||
@ -88,6 +88,11 @@ if "%DOC_PY%" == "1" (
|
|||||||
goto EOF
|
goto EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if "%CMAKE%" == "" (
|
||||||
|
echo Cmake not found in path, required for building, exiting...
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
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"
|
call "%BLENDER_DIR%\build_files\windows\check_libraries.cmd"
|
||||||
|
Loading…
Reference in New Issue
Block a user