Skip to content

Commit

Permalink
Merge remote-tracking branch 'OFW/hedger/vscode4gcc12' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Feb 13, 2024
2 parents fdde585 + 9d5135d commit 7d7f15b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
12 changes: 3 additions & 9 deletions .vscode/example/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@
"cortex-debug.enableTelemetry": false,
"cortex-debug.variableUseNaturalFormat": true,
"cortex-debug.showRTOS": true,
"cortex-debug.armToolchainPath.windows": "${workspaceFolder}/toolchain/x86_64-windows/bin",
"cortex-debug.armToolchainPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/bin",
"cortex-debug.armToolchainPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/bin",
"cortex-debug.openocdPath.windows": "${workspaceFolder}/toolchain/x86_64-windows/openocd/bin/openocd.exe",
"cortex-debug.openocdPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/openocd/bin/openocd",
"cortex-debug.openocdPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/openocd/bin/openocd",
"cortex-debug.gdbPath.windows": "${workspaceFolder}/toolchain/x86_64-windows/bin/arm-none-eabi-gdb-py.bat",
"cortex-debug.gdbPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/bin/arm-none-eabi-gdb-py",
"cortex-debug.gdbPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/bin/arm-none-eabi-gdb-py",
"cortex-debug.armToolchainPath": "${workspaceFolder}/toolchain/current/bin",
"cortex-debug.openocdPath": "${workspaceFolder}/toolchain/current/bin/openocd",
"cortex-debug.gdbPath": "${workspaceFolder}/toolchain/current/bin/arm-none-eabi-gdb-py3",
"editor.formatOnSave": true,
"files.associations": {
"*.scons": "python",
Expand Down
6 changes: 3 additions & 3 deletions scripts/toolchain/fbtenv.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ set "FBT_TOOLCHAIN_ROOT=%FBT_TOOLCHAIN_PATH%\toolchain\x86_64-windows"
set "FBT_TOOLCHAIN_VERSION_FILE=%FBT_TOOLCHAIN_ROOT%\VERSION"

if not exist "%FBT_TOOLCHAIN_ROOT%" (
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%"
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%" || exit /b
)

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%"
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%" || exit /b
)

set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_VERSION_FILE%"
if not "%REAL_TOOLCHAIN_VERSION%" == "%FLIPPER_TOOLCHAIN_VERSION%" (
echo FBT: starting toolchain upgrade process..
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%"
powershell -ExecutionPolicy Bypass -File "%FBT_ROOT%\scripts\toolchain\windows-toolchain-download.ps1" %flipper_toolchain_version% "%FBT_TOOLCHAIN_ROOT%" || exit /b
set /p REAL_TOOLCHAIN_VERSION=<"%FBT_TOOLCHAIN_VERSION_FILE%"
)

Expand Down
3 changes: 3 additions & 0 deletions scripts/toolchain/fbtenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,12 @@ fbtenv_show_unpack_percentage()
fbtenv_unpack_toolchain()
{
echo "Unpacking toolchain to '$FBT_TOOLCHAIN_PATH/toolchain':";
rm $FBT_TOOLCHAIN_PATH/toolchain/current || true;
tar -xvf "$FBT_TOOLCHAIN_PATH/toolchain/$TOOLCHAIN_TAR" -C "$FBT_TOOLCHAIN_PATH/toolchain" 2>&1 | fbtenv_show_unpack_percentage;
mkdir -p "$FBT_TOOLCHAIN_PATH/toolchain" || return 1;
mv "$FBT_TOOLCHAIN_PATH/toolchain/$TOOLCHAIN_DIR" "$TOOLCHAIN_ARCH_DIR" || return 1;
printf "linking toolchain to 'current'..";
ln -s "$TOOLCHAIN_ARCH_DIR" "$FBT_TOOLCHAIN_PATH/toolchain/current" || return 1;
echo "done";
return 0;
}
Expand Down
9 changes: 9 additions & 0 deletions scripts/toolchain/windows-toolchain-download.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ if (Test-Path -LiteralPath "$toolchain_target_path") {
Remove-Item -LiteralPath "$toolchain_target_path" -Force -Recurse
Write-Host "done!"
}

if (Test-path -Path "$toolchain_target_path\..\current") {
Write-Host -NoNewline "Unlinking 'current'.."
Remove-Item -LiteralPath "$toolchain_target_path\..\current" -Force
Write-Host "done!"
}

if (!(Test-Path -Path "$toolchain_zip_temp_path" -PathType Leaf)) {
Write-Host -NoNewline "Downloading Windows toolchain.."
$wc = New-Object net.webclient
Expand All @@ -42,6 +49,8 @@ Add-Type -Assembly "System.IO.Compression.Filesystem"

Write-Host -NoNewline "moving.."
Move-Item -LiteralPath "$toolchain_dist_temp_path" -Destination "$toolchain_target_path" -Force
Write-Host -NoNewline "linking to 'current'.."
cmd /c mklink /J "$toolchain_target_path\..\current" "$toolchain_target_path"
Write-Host "done!"

Write-Host -NoNewline "Cleaning up temporary files.."
Expand Down

0 comments on commit 7d7f15b

Please sign in to comment.