.

Fangrui Song 2018-06-08 21:11:55 -07:00
parent b144cd25bd
commit 0f74f1812f

@ -7,7 +7,7 @@
### Build the ccls language server
* Mac OS X: [homebrew-ccls](https://github.com/twlz0ne/homebrew-ccls)
* Arch Linux: [aur/ccls-git](https://aur.archlinux.org/packages/ccls-git)
* Arch Linux: [aur/ccls-git](https://aur.archlinux.org/packages/ccls-git) `extra/clang-6.0.0-1` has a bug, don't use this for now
For all others, below are the quick commands for the impatient. Detailed instructions can be found at [[Build]].
@ -25,6 +25,7 @@ Additional notes: If your `libstdc++` is too old (no C++17 header files) or have
* FreeBSD 11, Linux with `clang+llvm<6`: `cmake -H. -Brelease -DCLANG_USE_BUNDLED_LIBC++=on`
* FreeBSD 12, Linux with newer libstdc++/clang/llvm (e.g. Arch Linux): `cmake -H. -Brelease -DSYSTEM_CLANG=on -DUSE_SHARED_LLVM=on`
* Linux with `gcc < 7` but `clang >= 5`, `cmake -H. -Brelease -DCMAKE_CXX_COMPILER=clang++`
### Setup your editor
@ -65,7 +66,30 @@ If your project uses `-std=c++1z` `-std=c++17`, you likely need to add `-D__cpp_
### Windows
If your project is compiled with MSVC, you may change the compiler driver (`%clang` above) to `clang-cl`, and use the initialization option `extraClangArguments` to pass three options:
If your project is compiled with MSVC, you may change the compiler driver (`%clang` above) to `clang-cl`, and use the initialization option `clang.extraArgs` to pass three options:
`-fms-extensions -fms-compatibility -fdelayed-template-parsing`.
See https://clang.llvm.org/docs/MSVCCompatibility.html
### Cases
On a laptop with one (i7-6600U CPU @ 2.60GHz, hyper-threading, `nproc`=4), 4 indexers.
llvm+clang+extra+lld+compiler-rt (2017-06-10)
* initial indexing: 1 hour; load: 20s
* resident set size is about 1GiB (the peak RSS during indexing is below 2GiB)
* `du -sh .ccls-cache` => 580M
radare2 (2017-06-10)
```
CC=clang CXX=clang++ LDFLAGS=-fuse-ld=lld meson . debug --buildtype=debug --prefix ~/.config/radare2/debug
ln -s debug/compile_commands.json
```
* initial indexing: 78s; load: 3s
* 300MiB
* `du -sh .ccls-cache` => 107M
Note: ccls can serve LSP requests while it is doing the initial indexing of the project.