From 5c8784c9f42ef7f377850fe513bcbe7625593cf7 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 22 Apr 2023 15:14:05 +0200 Subject: [PATCH] Add note on compile_commands.json to readme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 95f60d4..6d2a518 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,15 @@ but you can find them in `flake.nix`. You can use `nix develop` or [`direnv`](https://direnv.net/). +To create a `compile_commands.json` for `ccls` (or similar), +create a `build` directory inside the exercise directory, +and from that, execute: + +```bash +cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=YES +ln -sf build/compile_commands.json .. +``` + ## Licence [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html).