2022-07-14 19:24:26 +03:00
|
|
|
@echo off
|
|
|
|
|
2022-11-12 21:28:29 +03:00
|
|
|
if not ["%FBT_ROOT%"] == [""] (
|
2022-07-14 19:24:26 +03:00
|
|
|
goto already_set
|
|
|
|
)
|
|
|
|
|
|
|
|
set "FBT_ROOT=%~dp0\..\..\"
|
2022-11-12 20:22:40 +03:00
|
|
|
pushd "%FBT_ROOT%"
|
2022-07-14 19:24:26 +03:00
|
|
|
set "FBT_ROOT=%cd%"
|
|
|
|
popd
|
|
|
|
|
2022-11-12 21:28:29 +03:00
|
|
|
if not ["%FBT_NOENV%"] == [""] (
|
2022-07-14 19:24:26 +03:00
|
|
|
exit /b 0
|
|
|
|
)
|
|
|
|
|
2023-02-20 15:21:29 +03:00
|
|
|
set "FLIPPER_TOOLCHAIN_VERSION=21"
|
2022-07-14 19:24:26 +03:00
|
|
|
|
2023-04-06 05:44:37 +03:00
|
|
|
if ["%FBT_TOOLCHAIN_PATH%"] == [""] (
|
|
|
|
set "FBT_TOOLCHAIN_PATH=%FBT_ROOT%"
|
2022-11-02 18:15:40 +03:00
|
|
|
)
|
2022-07-14 19:24:26 +03:00
|
|
|
|
2023-04-06 05:44:37 +03:00
|
|
|
set "FBT_TOOLCHAIN_ROOT=%FBT_TOOLCHAIN_PATH%\toolchain\x86_64-windows"
|
|
|
|
|
2022-11-12 20:22:40 +03:00
|
|
|
set "FBT_TOOLCHAIN_VERSION_FILE=%FBT_TOOLCHAIN_ROOT%\VERSION"
|
|
|
|
|
2022-07-14 19:24:26 +03:00
|
|
|
if not exist "%FBT_TOOLCHAIN_ROOT%" (
|
2022-11-12 20:22:40 +03:00
|
|
|
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%"
|
2022-07-14 19:24:26 +03:00
|
|
|
)
|
2022-11-12 20:22:40 +03:00
|
|
|
|
|
|
|
if not exist "%FBT_TOOLCHAIN_VERSION_FILE%" (
|
|
|
|
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%"
|
2022-07-14 19:24:26 +03:00
|
|
|
)
|
2022-11-02 18:15:40 +03:00
|
|
|
|
2022-11-12 20:22:40 +03:00
|
|
|
set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_VERSION_FILE%"
|
2022-07-14 19:24:26 +03:00
|
|
|
if not "%REAL_TOOLCHAIN_VERSION%" == "%FLIPPER_TOOLCHAIN_VERSION%" (
|
2023-02-15 19:56:25 +03:00
|
|
|
echo FBT: starting toolchain upgrade process..
|
2022-11-12 20:22:40 +03:00
|
|
|
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%"
|
2023-02-15 19:56:25 +03:00
|
|
|
set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_VERSION_FILE%"
|
2022-07-14 19:24:26 +03:00
|
|
|
)
|
|
|
|
|
2023-02-17 15:22:08 +03:00
|
|
|
if defined FBT_VERBOSE (
|
|
|
|
echo FBT: using toolchain version %REAL_TOOLCHAIN_VERSION%
|
|
|
|
)
|
|
|
|
|
2022-07-14 19:24:26 +03:00
|
|
|
set "HOME=%USERPROFILE%"
|
|
|
|
set "PYTHONHOME=%FBT_TOOLCHAIN_ROOT%\python"
|
2022-08-12 12:01:25 +03:00
|
|
|
set "PYTHONPATH="
|
2022-09-24 14:30:19 +03:00
|
|
|
set "PYTHONNOUSERSITE=1"
|
2022-07-14 19:24:26 +03:00
|
|
|
set "PATH=%FBT_TOOLCHAIN_ROOT%\python;%FBT_TOOLCHAIN_ROOT%\bin;%FBT_TOOLCHAIN_ROOT%\protoc\bin;%FBT_TOOLCHAIN_ROOT%\openocd\bin;%PATH%"
|
|
|
|
set "PROMPT=(fbt) %PROMPT%"
|
|
|
|
|
|
|
|
:already_set
|
|
|
|
|
|
|
|
if not "%1" == "env" (
|
|
|
|
echo *********************************
|
|
|
|
echo * fbt build environment *
|
|
|
|
echo *********************************
|
2022-07-26 00:31:34 +03:00
|
|
|
cd "%FBT_ROOT%"
|
2022-07-14 19:24:26 +03:00
|
|
|
cmd /k
|
|
|
|
)
|