# Base image: Ubuntu 24.04 for ARM cross-compilation toolchain
FROM ubuntu:24.04

# Install cross-compilation dependencies + clangd for dev container intellisense
RUN apt-get update && apt-get install -y \
    cmake \
    gcc-arm-none-eabi \
    libnewlib-arm-none-eabi \
    build-essential \
    git \
    python3 \
    clangd \
    && rm -rf /var/lib/apt/lists/*

# Clone the Pico SDK with submodules (TinyUSB, etc.)
RUN git clone https://github.com/raspberrypi/pico-sdk.git /opt/pico-sdk \
    && cd /opt/pico-sdk \
    && git submodule update --init

# Tell CMake where to find the Pico SDK
ENV PICO_SDK_PATH=/opt/pico-sdk

WORKDIR /project