u/000nan000

▲ 0 r/cpp

I wrote a dumb bash script to scaffold C++23 Modules + CMake + LSP (SDL/Raylib) in 2 seconds

Got tired of writing CMake boilerplates and fighting clangd every time I wanted to test a C++23 module or pop a Raylib window. So I wrote startcpp.

It’s just a single bash script. No Python, no vcpkg/conan bloat, no 50-file template structures.

What it actually sets up:

  • Generates a CMake config with FILE_SET CXX_MODULES and drops <iostream> for <print>.
  • Forces CMAKE_EXPORT_COMPILE_COMMANDS and symlinks it to root. Neovim/clangd picks it up instantly.
  • Dependency pipeline for --raylib, --sdl2 or --sdl3: tries find_package first for system binaries. Silently falls back to CPM (FetchContent) to pull the github tag if you don't have it installed locally.
  • Injects ccache and defaults to Ninja.

Usage: startcpp test_proj --raylib ninja -C build

There's a quick video in the README showing the setup.

Repo: https://github.com/V1niciosLins/StartCpp/

reddit.com
u/000nan000 — 1 day ago