mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 07:35:08 +00:00
-resource-dir
parent
93f85fcf3d
commit
024f81c931
23
FAQ.md
23
FAQ.md
@ -8,7 +8,7 @@ There are at least three sets of implicit include paths. They take effect withou
|
||||
#include <stdio.h>
|
||||
// system C++ header. The location varies among distributions, e.g. /usr/include/c++/{6,7.2.1}
|
||||
#include <new>
|
||||
// In Clang resource directory
|
||||
// In Clang resource directory lib/clang/7.0.0, lib/clang/7.0.0/include/stddef.h
|
||||
#include <stddef.h>
|
||||
```
|
||||
|
||||
@ -18,20 +18,13 @@ Note that this might not work on Windows. To solve this, add the system include
|
||||
|
||||
For CMake this can be achieved in a single line: `target_include_directories(<target> SYSTEM PRIVATE $ENV{INCLUDE})`
|
||||
|
||||
#### If `-resource-dir` is correct
|
||||
#### Check if `-resource-dir` is correct
|
||||
|
||||
If the [[initialization option|Initialization options]] `cacheDirectory` is `/tmp/ccls`, and the source file is `/tmp/c/a.cc`.
|
||||
Set [[Initialization options]] `"cacheFormat": "json"` and run `jq . < /tmp/ccls/@tmp@c/a.cc.json` to see if `-resource-dir` is correct, e.g. `"-resource-dir=/home/ray/Dev/Util/ccls/Debug/lib/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/lib/clang/6.0.0"`
|
||||
Check `Clang_EXECUTABLE` in your `CMakeCache.txt`. The output of command `$Clang_EXECUTABLE -print-resource-dir` will be passed to `-DDEFAULT_RESOURCE_DIRECTORY`. Make sure you can locate `include/stddef.h` in the resource directory.
|
||||
|
||||
system C/C++ headers can be detected reliably. For Clang resource directory, there is logic in `wscript` to detect it when you run `./waf configure [OPTIONS]`
|
||||
|
||||
* For `--bundled-clang=5.0.1`: `../lib/clang+llvm-5.0.1-x86_64-linux-gnu-ubuntu-14.04/lib/clang/5.0.1` which is relative to the `build/release/bin/ccls` executable.
|
||||
The relative path of `build/release/bin/ccls` and `build/release/lib/` cannot change, otherwise libclang.so used by ccls cannot find the Clang resource directory.
|
||||
* For `--use-system-clang`: it is recognized from `-resource-dir` option in the output of `clang++ '-###' -xc /dev/null`)
|
||||
|
||||
```bash
|
||||
./waf configure --prefix /tmp/opt && ./waf install
|
||||
```
|
||||
Read [[Initialization options]] how to set `"cacheFormat": "json"`.
|
||||
If `"cacheDirectory": "/tmp/ccls"`, and the source file is `/tmp/c/a.cc`,
|
||||
run `jq . < /tmp/ccls/@tmp@c/a.cc.json` to see if `-resource-dir` is correct, e.g. `"-resource-dir=/home/ray/ccls/Debug/lib/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/lib/clang/6.0.0"`
|
||||
|
||||
#### `-isystem`
|
||||
|
||||
@ -47,7 +40,7 @@ If you want the ccls binary at a specific location use a symlink - do not move t
|
||||
|
||||
If you want to specify additional search paths:
|
||||
|
||||
* `print '%clang\n%cpp -std=gnu++14\n-isystem/tmp/include' > .ccls`
|
||||
* `print '%clang\n%cpp -std=gnu++17\n-isystem/tmp/include' > .ccls`
|
||||
* emacs-ccls: `(setq ccls-extra-init-params '(:clang (:extraArgs ["-isystem", "/tmp/include"])))`
|
||||
|
||||
### `-std=c++1z` `-std=c++17` `bits/unordered_map.h`
|
||||
@ -198,4 +191,4 @@ ccls will save a file in `cacheDirectory`:
|
||||
|
||||
### [`$ccls/memberHierarchy`](https://github.com/MaskRay/ccls/blob/master/src/messages/ccls_memberHierarchy.cc)
|
||||
|
||||
Recursively list members of a record type. 😂 nobody has implemented UI for the feature. Help wanted!
|
||||
Recursively list members of a record type. 😂 nobody has implemented vscode-ccls UI for the feature. Help wanted!
|
||||
|
Loading…
Reference in New Issue
Block a user