Updated Project Setup (markdown)

Andrew Zabavnikov 2022-09-09 15:07:47 +03:00
parent c25f994e98
commit 97513bcf37

@ -85,6 +85,12 @@ Caveat on Windows: CMake dumps Windows shell command line directly into `command
jq '[.[] | {directory: .directory, file: .file, arguments: .command | split(" ") | map(select(length > 0)) | map(sub("\\\\\""; "\""; "g"))}]' < compile_commands.json jq '[.[] | {directory: .directory, file: .file, arguments: .command | split(" ") | map(select(length > 0)) | map(sub("\\\\\""; "\""; "g"))}]' < compile_commands.json
``` ```
In some setups, CMake also puts source file of a translation unit (i.e. `*.cpp` file) after two dashes `--`, which means that after it no command-line options can be given. Unfortunately, `ccls` currently tries to add them just to the end. This modification of above helps:
```sh
jq '[.[] | {directory: .directory, file: .file, arguments: .command | split(" ") | map(select(length > 0 and . != "--")) | 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`.