mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 07:35:08 +00:00
Build: Simplify CMAKE_PREFIX_PATH
parent
83a32f3163
commit
d3c20f45f3
29
Build.md
29
Build.md
@ -93,7 +93,9 @@ for your system, as well as methods of obtaining and locating Clang+LLVM.
|
||||
* `-DCMAKE_PREFIX_PATH=<path>`
|
||||
|
||||
Specify paths where CMake can locate Clang/LLVM headers and libraries.
|
||||
CMake searches the paths in `CMAKE_PREFIX_PATH` for `include` and `lib`.
|
||||
CMake searches the paths in `CMAKE_PREFIX_PATH` for
|
||||
`lib/cmake/clang/ClangConfig.cmake`, `lib/cmake/llvm/LLVMConfig.cmake`,
|
||||
`include` and `lib`.
|
||||
|
||||
* `-DUSE_SYSTEM_RAPIDJSON=(ON|OFF)`
|
||||
|
||||
@ -288,7 +290,7 @@ ninja -C Release clangFormat clangFrontendTool clangIndex clangTooling clang
|
||||
|
||||
# Download ccls
|
||||
cd ccls
|
||||
cmake -H. -BRelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_PREFIX_PATH="D:/llvm/Release;D:/llvm/Release/tools/clang;D:/llvm;D:/llvm/tools/clang"
|
||||
cmake -H. -BRelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_PREFIX_PATH="D:/llvm/Release"
|
||||
ninja -C Release
|
||||
```
|
||||
|
||||
@ -324,30 +326,23 @@ Then build ccls with `-DCMAKE_PREFIX_PATH`:
|
||||
```sh
|
||||
cd ~/ccls
|
||||
LLVM=$HOME/llvm-project
|
||||
cmake -H. -BRelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld -DCMAKE_PREFIX_PATH="$LLVM/Release;$LLVM/llvm;$LLVM/clang"
|
||||
cmake -H. -BRelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld -DCMAKE_PREFIX_PATH="$LLVM/Release"
|
||||
ninja -C Release
|
||||
```
|
||||
|
||||
`-DCMAKE_PREFIX_PATH=` is a `;`-separated list where you can find:
|
||||
|
||||
* `llvm`: llvm source
|
||||
* `llvm/tools/clang`: clang source
|
||||
* `llvm/Release`: build directory. `include/` contains generated llvm header files, e.g. `include/llvm/Config/config.h`
|
||||
* `llvm/Release/tools/clang`: build directory. `include/` contains generated clang header files, e.g. `include/clang/Config/config.h`
|
||||
|
||||
The cmake build system is expected to find these files:
|
||||
`-DCMAKE_PREFIX_PATH=` is a `;`-separated list. The cmake build system is expected to find these files:
|
||||
|
||||
```
|
||||
# generated clang+llvm header files
|
||||
~/llvm/Release/include/llvm/Config/config.h
|
||||
~/llvm/Release/tools/clang/include/clang/Config/config.h
|
||||
include/llvm/Config/config.h
|
||||
tools/clang/include/clang/Config/config.h
|
||||
# libclangIndex.so
|
||||
~/llvm/Release/lib/libclangIndex.so or libclangIndex.a
|
||||
lib/libclangIndex.so or libclangIndex.a
|
||||
# -resource-dir
|
||||
~/llvm/Release/lib/clang/7.0.0
|
||||
lib/clang/7.0.0
|
||||
# clang+llvm libraries
|
||||
~/llvm/Release/lib/libclangDriver.so
|
||||
~/llvm/Release/lib/libLLVMSupport.so or libLLVMSupport.a
|
||||
lib/libclangDriver.so
|
||||
lib/libLLVMSupport.so or libLLVMSupport.a
|
||||
...
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user