From b6613e2b4c280ba0eced0c0007de3237477f05bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=B7=E5=B0=8F=E5=B9=BF?= Date: Wed, 27 Jun 2018 11:43:19 -0500 Subject: [PATCH] change cquery to ccls and improve indentation --- Build.md | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/Build.md b/Build.md index c3b4c6d..1547b36 100644 --- a/Build.md +++ b/Build.md @@ -17,51 +17,51 @@ are not supported at the moment. * `-DCMAKE_BUILD_TYPE=(Debug|MinSizeRel|Release|RelWithDebInfo)` -Default: Release -Set the build type. The most important ones are Debug and Release. + Default: Release + Set the build type. The most important ones are Debug and Release. * `-DSYSTEM_CLANG=(ON|OFF)` -Default: ON -Enable `SYSTEM_CLANG` if you want to link ccls against a system installation -of Clang instead of downloading Clang from releases.llvm.org during the configure process. + Default: ON + Enable `SYSTEM_CLANG` if you want to link ccls against a system installation + of Clang instead of downloading Clang from releases.llvm.org during the configure process. -``` -% cmake -H. -Brelease -DCMAKE_INSTALL_PREFIX=/usr -DSYSTEM_CLANG=On -% cmake --build release -``` + ``` + % cmake -H. -Brelease -DCMAKE_INSTALL_PREFIX=/usr -DSYSTEM_CLANG=On + % cmake --build release + ``` * `-DCLANG_USE_BUNDLED_LIBC++=on` -`clang+llvm*` downloaded from releases.llvm.org also provides libc++ libraries. -If your `libstdc++` is too old, you can use `libc++` in the bundled clang+llvm archive: + `clang+llvm*` downloaded from releases.llvm.org also provides libc++ libraries. + If your `libstdc++` is too old, you can use `libc++` in the bundled clang+llvm archive: -```zsh -# If your clang++ is old, you may rerun this command with clang++ replaced to -# the absolute path of bundled/clang+llvm-*/bin/clang++ -cmake -H. -Brelease -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCLANG_USE_BUNDLED_LIBC++=on -``` + ```zsh + # If your clang++ is old, you may rerun this command with clang++ replaced to + # the absolute path of bundled/clang+llvm-*/bin/clang++ + cmake -H. -Brelease -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCLANG_USE_BUNDLED_LIBC++=on + ``` * `-DCMAKE_PREFIX_PATH="custom_install_path"` -When you want to use a system installed Clang but it is not installed into any -default CMake search location (for example if you built LLVM from source) you -can tell CMake where to search by adding search paths to `CMAKE_PREFIX_PATH`. -CMake searches the paths in `CMAKE_PREFIX_PATH` for 'include' and 'lib' -subdirectories containing the required Clang headers and libraries. For example, -to use a system installation of Clang on Windows you can add the following -option: `-DCMAKE_PREFIX_PATH="C:/Program Files/LLVM"`. + When you want to use a system installed Clang but it is not installed into any + default CMake search location (for example if you built LLVM from source) you + can tell CMake where to search by adding search paths to `CMAKE_PREFIX_PATH`. + CMake searches the paths in `CMAKE_PREFIX_PATH` for 'include' and 'lib' + subdirectories containing the required Clang headers and libraries. For example, + to use a system installation of Clang on Windows you can add the following + option: `-DCMAKE_PREFIX_PATH="C:/Program Files/LLVM"`. -You may add directories for `include` and `lib` separated by a `;`, e.g. to use trunk clang: -`-DCMAKE_PREFIX_PATH="$HOME/Dev/llvm/release;$HOME/Dev/llvm/tools/clang"` + You may add directories for `include` and `lib` separated by a `;`, e.g. to use trunk clang: + `-DCMAKE_PREFIX_PATH="$HOME/Dev/llvm/release;$HOME/Dev/llvm/tools/clang"` * `-DUSE_SHARED_LLVM=on` -Link against `libLLVM.so` instead of `libLLVMSupport.a libLLVMDemangle.a ...` + Link against `libLLVM.so` instead of `libLLVMSupport.a libLLVMDemangle.a ...` ## Windows -If using Windows the automatically downloaded LLVM binaries are 64-bit; you should build cquery in 64-bit as well. You can tell cmake to build 64-bit using `-DCMAKE_GENERATOR_PLATFORM=x64` +If using Windows the automatically downloaded LLVM binaries are 64-bit; you should build ccls in 64-bit as well. You can tell cmake to build 64-bit using `-DCMAKE_GENERATOR_PLATFORM=x64` ## Link against clang+llvm libraries compiled from source @@ -77,7 +77,7 @@ cd ~/Dev cmake -H. -Brelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_SHARED_LIBS=ON -DLLVM_ENABLE_LLD=ON -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_GO_TESTS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_USE_SPLIT_DWARF=On -DLLVM_OPTIMIZED_TABLEGEN=On ``` -Remove `LLVM_ENABLE_LLD` if don't have lld (a much faster linker than bfd/gold) installed +Remove `LLVM_ENABLE_LLD` if don't have lld (a much faster linker than bfd/gold) installed Remove `BUILD_SHARED_LIBS` if you want to build static libraries (`libclangDriver.a` `libLLVMSupport.a`, note `libclang.so` is still a shared object) Then build ccls: