From 3a0d6c6ac4168b1ad5862acc774347b28464f7c3 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 31 Mar 2018 17:42:35 -0700 Subject: [PATCH] Created Getting started (markdown) --- Getting-started.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Getting-started.md diff --git a/Getting-started.md b/Getting-started.md new file mode 100644 index 0000000..555a47f --- /dev/null +++ b/Getting-started.md @@ -0,0 +1,56 @@ +### Outline + +1. Build ccls / prebuilt binary (below) +2. Setup your editor [[Editor configuration]] +3. Project setup: generate `compile_commands.json` or `.ccls` + +### Build the language server + +Detailed instructions at [[Build (Waf)]] and [[Build (CMake)]]. + +```bash +1 $ git clone https://github.com/ccls-project/ccls --single-branch --depth=1 +2 $ cd ccls +3 $ git submodule update --init && ./waf configure build # --variant=debug if you want to report issues. +``` + +If syncing, only `3` needs to be rerun. + +The executable is at `build/release/bin/ccls`. + +There are also prebuilt binaries on . "Source code" tarballs do not include submodules and do not build by themselves. + +If you come across crashes, **please [[build with --variant=debug|Build (Waf)]] and report issues with detailed stack trace**. + +### Project setup + +#### [[compile_commands.json]] (Best) + +Remember to copy/symlink it to the project root. + +#### `.ccls` + +Another way is to create a file named `.ccls` located in the project root. ccls recursively finds source files and indexes them. `.ccls` can also exist in subdirectories which will affect the options in its subtree. *Notice* If you use emacs-ccls, read the document of `ccls-project-root-matchers` to locate the project root correctly. + +If `%clang` is used, it expands to `clang/clang++` according to the extension name. Prefix options with `%c ` or `%cpp ` to make it specific to C or C++. + +Example `.ccls`: + +``` +%clang +%c -std=gnu11 +%cpp -std=gnu++14 +-pthread + +# Includes +-I/work/ccls/third_party +-I/work/ccls/another_third_party +# -I space_is_not_allowed +``` +Note: +`.ccls` does not do `word` splitting or `command` substitution for you, +you cannot use `` `command` `` or space-separated arguments like `%cpp -std=gnu++14 -pthread` + +### Windows + +`-fms-extensions -fms-compatibility -fdelayed-template-parsing` in clang-cl mode. \ No newline at end of file