mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-21 15:15:07 +00:00
Update README
This commit is contained in:
parent
27a00d7ad3
commit
75774e24bf
34
README.md
34
README.md
@ -63,35 +63,9 @@ still being developed.
|
||||
If you run into issues, you can view debug output by running the
|
||||
(`F1`) `View: Toggle Output` command and opening the `cquery` output section.
|
||||
|
||||
## Project setup (system includes, clang configuration)
|
||||
## Project setup
|
||||
|
||||
### Part 1: System includes
|
||||
|
||||
cquery will likely fail to resolve system includes like `stddef.h` or
|
||||
`<vector>` unless the include path is updated to point to them. Add the
|
||||
system include paths to `cquery.index.extraClangArguments`. For example,
|
||||
|
||||
```js
|
||||
{
|
||||
// ...
|
||||
"cquery.index.extraClangArguments": [
|
||||
// Generated by running the following in a Chrome checkout:
|
||||
// $ ./third_party/llvm-build/Release+Asserts/bin/clang++ -v ash/debug.cc
|
||||
"-isystem/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8",
|
||||
"-isystem/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8",
|
||||
"-isystem/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward",
|
||||
"-isystem/usr/local/include",
|
||||
"-isystem/PATH/TO/CHROME/src/third_party/llvm-build/Release+Asserts/lib/clang/5.0.0/include",
|
||||
"-isystem/usr/include/x86_64-linux-gnu",
|
||||
"-isystem/usr/include",
|
||||
],
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Part 2: Clang configuration
|
||||
|
||||
#### compile_commands.json (Best)
|
||||
### compile_commands.json (Best)
|
||||
|
||||
To get the most accurate index possible, you can give cquery a compilation
|
||||
database emitted from your build system of choice. For example, here's how to
|
||||
@ -103,13 +77,13 @@ $ ninja -C out/Release -t compdb cxx cc > compile_commands.json
|
||||
|
||||
The `compile_commands.json` file should be in the top-level workspace directory.
|
||||
|
||||
#### cquery.index.extraClangArguments
|
||||
### cquery.index.extraClangArguments
|
||||
|
||||
If for whatever reason you cannot generate a `compile_commands.json` file, you
|
||||
can add the flags to the `cquery.index.extraClangArguments` configuration
|
||||
option.
|
||||
|
||||
#### clang_args
|
||||
### clang_args
|
||||
|
||||
If for whatever reason you cannot generate a `compile_commands.json` file, you
|
||||
can add the flags to a file called `clang_args` located in the top-level
|
||||
|
Loading…
Reference in New Issue
Block a user