-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Karn Kaul edited this page Oct 18, 2020
·
4 revisions
Welcome to the ramp-up wiki!
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.
- Install all the tools, plugins, etc
- Clone the repo to a local directory, henceforth referred to as
.
- [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
- The repo's CMake script now downloads and sets up SFML by default on Windows and Linux
- 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
- [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 - If generation is successful, create a symlink in
.
to./out/debug/compile_commands.json
- Disable C/C++ Intellisense in VSCode and enable clangd
- Open the project directory, switch to the Output window, select
clangd language server
and ensure it's parsing the JSON generated above - Ensure clang-format and editor config plugins are working
- Set up tasks.json to invoke
cmake --build out/debug
as the main build task - Set up launch.json to invoke
out/debug/ramp-up[.exe]
(and use gdb as the debugger on Linux) as the main launch task - Try building and running the project
- Ensure breakpoints, watching variables, etc works
You're ready to start coding!