-
Notifications
You must be signed in to change notification settings - Fork 35
/
pico-setup.cmd
61 lines (46 loc) · 1.38 KB
/
pico-setup.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
set interactive=%~1
call "%~dp0pico-env.cmd" || exit /b 1
setlocal enabledelayedexpansion
rem This is mostly a port of pico-setup
rem https://github.com/raspberrypi/pico-setup/blob/master/pico_setup.sh
set "GITHUB_PREFIX=https://github.com/raspberrypi/"
set "GITHUB_SUFFIX=.git"
set "SDK_BRANCH=master"
pushd "%~dp0"
for %%i in (sdk examples extras playground project-generator) do (
set "DEST=%~dp0pico-%%i"
if exist "!DEST!\.git" (
echo !DEST! exists, skipping clone
) else (
set "REPO_URL=%GITHUB_PREFIX%pico-%%i%GITHUB_SUFFIX%"
echo Cloning !REPO_URL!
git clone -b %SDK_BRANCH% !REPO_URL! || exit /b 1
rem Any submodules
pushd "!DEST!"
git submodule update --init || exit /b 1
popd
set "PICO_%%i_PATH=!DEST!"
)
)
rem Build a couple of examples
mkdir "%~dp0pico-examples\build"
pushd "%~dp0pico-examples\build"
cmake -G "NMake Makefiles" .. -DCMAKE_BUILD_TYPE=Debug || exit /b 1
for %%i in (blink hello_world) do (
echo Building %%i
pushd %%i
nmake || exit /b 1
popd
)
popd
if exist "%~dp0pico-docs.ps1" (
echo Downloading Pico documents and files...
powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "%~dp0pico-docs.ps1" || exit /b 1
)
if "%interactive%" equ "1" (
rem Open repo folder in Explorer
start .
rem Keep the terminal window open
pause
)
popd