Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ccache support #2856

Merged
merged 11 commits into from
Jul 7, 2024
Prev Previous commit
Next Next commit
Review Windows install scripts
Install ninja, ccache
Don't overwrite MinGW if it already exists
mikee47 committed Jul 7, 2024
commit 46ad868dc0b29fb7cf2a239b798b27f5491dd0c1
30 changes: 20 additions & 10 deletions Sming/Arch/Esp32/Tools/install.cmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
REM Esp32 install.cmd

if "%IDF_PATH%"=="" goto :EOF
if "%IDF_TOOLS_PATH%"=="" goto :EOF
if "%IDF_PATH%"=="" goto :undefined
if "%IDF_TOOLS_PATH%"=="" goto :undefined

if exist "%IDF_PATH%" goto :setup
if exist "%IDF_PATH%" goto :cloned

if "%IDF_REPO%"=="" set IDF_REPO="https://github.com/mikee47/esp-idf.git"
if "%INSTALL_IDF_VER%"=="" set INSTALL_IDF_VER=5.2
@@ -14,6 +14,23 @@ if "%CI_BUILD_DIR%" NEQ "" (
)
git clone -b %IDF_BRANCH% %IDF_REPO% %IDF_PATH% %IDF_INSTALL_OPTIONS%

goto :setup


:undefined
echo.
echo ** Cannot install Esp32 tools: IDF_PATH or IDF_TOOLS_PATH not defined
echo.
goto :EOF


:cloned
echo.
echo ** Skipping ESP-IDF clone: '%IDF_PATH%' exists
echo.
goto :setup


:setup

REM Install IDF tools and packages
@@ -24,10 +41,3 @@ python3 "%IDF_PATH%\tools\idf_tools.py" --non-interactive install-python-env
if "%CI_BUILD_DIR%" NEQ "" (
del /q "%IDF_TOOLS_PATH%\dist\*"
)

if "%INSTALL_IDF_VER%" == "5.0" goto :install_python
if "%INSTALL_IDF_VER%" == "5.2" goto :install_python
goto :EOF

:install_python
python "%IDF_PATH%\tools\idf_tools.py" --non-interactive install-python-env
19 changes: 19 additions & 0 deletions Sming/Arch/Esp8266/Tools/install.cmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
REM Esp8266 install.cmd

if "%ESP_HOME%" == "" goto :undefined
if exist "%ESP_HOME%" goto :installed

set EQT_REPO=https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.2.0-gcc10.3
set EQT_TOOLCHAIN=x86_64-w64-mingw32.xtensa-lx106-elf-c791b74.230224.zip

mkdir %ESP_HOME%
curl -Lo %DOWNLOADS%/%EQT_TOOLCHAIN% %EQT_REPO%/%EQT_TOOLCHAIN%
7z -o%ESP_HOME% x %DOWNLOADS%/%EQT_TOOLCHAIN%

goto :EOF


:undefined
echo.
echo ** Cannot install Esp8266 tools: ESP_HOME not defined
echo.
goto :EOF


:installed
echo.
echo ** Skipping Esp8266 tools installation: '%ESP_HOME%' exists
echo.
goto :EOF
15 changes: 13 additions & 2 deletions Sming/Arch/Rp2040/Tools/install.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
REM Rp2040 install.cmd

if exist "%PICO_TOOLCHAIN_PATH%/arm-none-eabi" goto :already_got
if "%PICO_TOOLCHAIN_PATH%"=="" goto :undefined
if exist "%PICO_TOOLCHAIN_PATH%/arm-none-eabi" goto :installed

set TOOLCHAIN_VERSION=13.2.rel1
set TOOLCHAIN_BASE_URL=https://developer.arm.com/-/media/Files/downloads/gnu
set TOOLCHAIN_NAME=arm-gnu-toolchain-%TOOLCHAIN_VERSION%-mingw-w64-i686-arm-none-eabi
@@ -10,10 +12,19 @@ curl -Lo tmp.zip %TOOLCHAIN_BASE_URL%/%TOOLCHAIN_VERSION%/binrel/%TOOLCHAIN_FILE
del tmp.zip
move "%PICO_TOOLCHAIN_PATH%-tmp/%TOOLCHAIN_NAME%" "%PICO_TOOLCHAIN_PATH%"
rmdir "%PICO_TOOLCHAIN_PATH%-tmp"

goto :EOF


:undefined
echo.
echo ** Cannot install Rp2040 tools: PICO_TOOLCHAIN_PATH not defined
echo.
goto :EOF


:already_got
:installed
echo.
echo ** Skipping Rp2040 tools installation: '%PICO_TOOLCHAIN_PATH%' exists
echo.
goto :EOF
10 changes: 10 additions & 0 deletions Tools/install.cmd
Original file line number Diff line number Diff line change
@@ -20,6 +20,8 @@ python -m pip install --upgrade pip -r %SMING_HOME%\..\Tools\requirements.txt

choco install ninja ccache

if exist "C:\MinGW\bin" goto :mingw_installed

echo.
echo.
echo ** Installing MinGW
@@ -28,7 +30,15 @@ rmdir /s /q c:\MinGW
curl -Lo %DOWNLOADS%\MinGW.7z %SMINGTOOLS%/MinGW-2020-10-19.7z
7z -oC:\ x %DOWNLOADS%\MinGW.7z

goto :install

:mingw_installed
echo.
echo ** MinGW found, not re-installing
echo.

:install

if "%1" == "" goto :EOF
if "%1" == "all" (
call :install Host Esp8266 Esp32 Rp2040