Updated compile_commands.json (markdown)

Riatre Foo 2018-10-09 22:02:37 +08:00
parent 5f94c2bceb
commit d014f5d2a0

@ -8,6 +8,12 @@
% ln -s build/compile_commands.json % ln -s build/compile_commands.json
``` ```
Caveat on Windows: CMake dumps Windows shell command line directly into `command`, depends on how ccls was built, it may confuse this field as command line from a POSIX shell, in which Windows path separator '\\' is a escape character. You can use jq to convert such entries to use `arguments` which does not have this issue:
```sh
jq '[.[] | {directory: .directory, file: .file, arguments: .command | split(" ") | map(select(length > 0)) | map(sub("\\\\\""; "\""; "g"))}]' < compile_commands.json
```
### [Build EAR](https://github.com/rizsotto/Bear) ### [Build EAR](https://github.com/rizsotto/Bear)
Bear is a tool that generates a compilation database for clang tooling. It can be used for any project based on `Makefile`. Bear is a tool that generates a compilation database for clang tooling. It can be used for any project based on `Makefile`.