Skip to content
Karn Kaul edited this page Oct 18, 2020 · 4 revisions

Welcome to the ramp-up wiki!

Setting up

Requirements:

  • Operating systems (x64 only):
    • Windows 10
    • Linux (X11 / Wayland)
  • Editor: VSCode; plugins:
    • C/C++ (Microsoft)
    • Clang-Format
    • Clang-Tidy
    • EditorConfig
    • clangd
  • Compiler: clang++
  • Build tools: CMake + ninja
  • Dependencies:
    • LLVM x64 (clang etc)
    • SFML x64 (2D multimedia library)
    • clangd language server (Intellisense)

MinGW / Cygwin etc are not supported.

Building

  1. Install all the tools, plugins, etc
  2. Clone the repo to a local directory, henceforth referred to as .
  3. [Optional] Install SFML through your package manager, or extract the latest zip (VS2017 x64 for Windows) to a directory somewhere, and rename the root directory to sfml, say, ./ext/sfml
    1. The repo's CMake script now downloads and sets up SFML by default on Windows and Linux
  4. Configure and generate a build directory for the project using CMake: cmake . -B out/debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_EXPORT_COMPILE_COMMANDS=1
  5. [Optional] If CMake complains about SFML not being found, also pass -DSFML_DIR=./ext/sfml/lib/cmake/SFML; for any other errors ask for help
  6. If generation is successful, create a symlink in . to ./out/debug/compile_commands.json

Developing

  1. Disable C/C++ Intellisense in VSCode and enable clangd
  2. Open the project directory, switch to the Output window, select clangd language server and ensure it's parsing the JSON generated above
  3. Ensure clang-format and editor config plugins are working
  4. Set up tasks.json to invoke cmake --build out/debug as the main build task
  5. Set up launch.json to invoke out/debug/ramp-up[.exe] (and use gdb as the debugger on Linux) as the main launch task
  6. Try building and running the project
  7. Ensure breakpoints, watching variables, etc works

You're ready to start coding!

Clone this wiki locally