From 19d5330f37791e3c0ddf1be754acbb4add5e3b81 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 13 May 2018 09:38:51 -0700 Subject: [PATCH] . --- Build.md | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/Build.md b/Build.md index 6e1e779..329d016 100644 --- a/Build.md +++ b/Build.md @@ -4,35 +4,25 @@ * GCC 6 or higher * MSVC 2017 or higher (included with VS2017 Build Tools) -After installing the required dependencies, clone the repository along with its -git submodules using: -`git clone https://github.com/MaskRay/ccls --recursive` +See [[Getting-started]] for simple cmake build instructions. -``` -# create a build directory called `release` -% cmake -H. -Brelease - -# build -% cmake --build release -``` +You may append `-G Ninja -DCMAKE_CXX_LINK_FLAGS=-fuse-ld=lld -DCMAKE_CXX_COMPILER=clang++` [**Windows**] On Windows you have to explicitly tell CMake to target 64-bit architecture by adding the `-DCMAKE_GENERATOR_PLATFORM=x64` option to the cmake invocation (`cmake -DCMAKE_GENERATOR_PLATFORM=x64 ..`). 32-bit builds are not supported at the moment. -This command generates project files for your system's default generator (Linux: -make, Windows: MSBuild). CMake defaults to a Release build and links ccls -against the libclang library which it downloads from . - ## CMake Options * `-DCMAKE_BUILD_TYPE=(Debug|MinSizeRel|Release|RelWithDebInfo)` +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. @@ -43,6 +33,7 @@ of Clang instead of downloading Clang from releases.llvm.org during the configur * `-DCLANG_USE_BUNDLED_LIBC++=on` +`clang+llvm*` downloaded from releases.llvm.org also provides libc++ libraries. `libstdc++ >= 5.3` supports `experimental/filesystem`. If your `libstdc++` is old, you can use `libc++` in the bundled clang+llvm archive: ```zsh @@ -79,15 +70,8 @@ cmake --build release ``` ~/Dev/llvm/release/include/llvm/Config/config.h ~/Dev/llvm/release/tools/clang/include/clang/Config/config.h -``` - -``` -% tree ~/Dev/llvm/static-release/lib/ -L 3 -├── clang -│   └── 7.0.0 -│   ├── include -│   └── lib -├── libclang.so -> libclang.so.7 -├── libclang.so.7 -> libclang.so.7.0 -└── libclang.so.7.0 +# libclang +~/Dev/llvm/release/lib/libclang.so +# -resource-dir +~/Dev/llvm/release/lib/clang/7.0.0 ```