Skip to content

Commit f29c25c

Browse files
committed
Document using clangd with VS Code
1 parent 7056df6 commit f29c25c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@ up-to-date later on.
167167
For a debug build, use `-DCMAKE_BUILD_TYPE=Debug`. To tweak various settings (e.g. warnings) for development,
168168
use `-DENABLE_DEVEL_DEFAULTS=ON`.
169169

170+
To use `clangd` via Visual Studio Code, specify `-DCMAKE_EXPORT_COMPILE_COMMANDS=1`. Then link the
171+
`compile_commands.json` file from the build directory into the source directory. When using the `subdirs`
172+
project you can create a symlink to the subdirs project in the individual projects (e.g.
173+
`compile_commands.json -> ../subdirs/syncthingtray/compile_commands.json`) and a symlink to the actual build
174+
directory in the subdirs project (e.g.
175+
`compile_commands.json -> /…/build/presets/syncthingtray/arch-android-x86_64/compile_commands.json`).
176+
170177
#### CMake presets
171178
There are some generic [presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) available.
172179

0 commit comments

Comments
 (0)