from pathlib import Path


def list_source_files(base_dir: Path) -> list[Path]:
    """List source files.

    Args:
        base_dir (Path): Base directory.

    Returns:
        list[Path]: Paths of source files.
    """

    files = []
    for child in base_dir.iterdir():
        if child.is_dir():
            files = files + list_source_files(child)
        elif child.is_file() and str(child.suffix) == ".cpp":
            files = files + [child]
    return files