-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathpico-env.cmd
67 lines (50 loc) · 1.82 KB
/
pico-env.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@if not defined _echo echo off
set errors=0
goto main
:AddToPath
if exist "%~1" (
set "PATH=%~1;%PATH%"
)
goto :EOF
:VerifyExe
echo Checking %1...
cmd /c %2 >NUL 2>NUL
if %ERRORLEVEL% neq 0 (
echo ERROR: %1 is required but was not found.
set /a errors += 1
)
goto :EOF
:main
for %%i in (sdk examples extras playground) do (
rem Environment variables in Windows aren't case-sensitive, so we don't need
rem to bother with uppercasing the env var name.
if exist "%~dp0pico-%%i" (
echo PICO_%%i_PATH=%~dp0pico-%%i
set "PICO_%%i_PATH=%~dp0pico-%%i"
)
)
if exist "%~dp0tools\openocd" (
echo OPENOCD_SCRIPTS=%~dp0tools\openocd\scripts
set "OPENOCD_SCRIPTS=%~dp0tools\openocd\scripts"
set "PATH=%~dp0tools\openocd;%PATH%"
)
call :AddToPath "%ProgramFiles(x86)%\doxygen\bin"
call :AddToPath "%ProgramFiles%\doxygen\bin"
call :AddToPath "%ProgramW6432%\doxygen\bin"
call :AddToPath "%ProgramFiles(x86)%\Graphviz\bin"
call :AddToPath "%ProgramFiles%\Graphviz\bin"
call :AddToPath "%ProgramW6432%\Graphviz\bin"
call :AddToPath "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"
call :AddToPath "%ProgramFiles%\Microsoft Visual Studio\Installer"
rem https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt
for /f "usebackq delims=" %%i in (`vswhere.exe -products * -requires "Microsoft.VisualStudio.Component.VC.Tools.x86.x64" -latest -property installationPath`) do (
if exist "%%i\Common7\Tools\vsdevcmd.bat" (
call "%%i\Common7\Tools\vsdevcmd.bat"
)
)
call :VerifyExe "GNU Arm Embedded Toolchain" "arm-none-eabi-gcc --version"
call :VerifyExe "CMake" "cmake --version"
call :VerifyExe "Visual Studio" "cl"
call :VerifyExe "Python 3" "python --version"
call :VerifyExe "Git" "git --version"
exit /b %errors%