diff --git a/Project-Setup.md b/Project-Setup.md index 2756380..098fc32 100644 --- a/Project-Setup.md +++ b/Project-Setup.md @@ -134,9 +134,11 @@ with open(os.path.join(sys.argv[1], 'compile_commands.json')) as f: ## `.ccls` File -`.ccls` is a line-based text file at the project root. Its main function is -to specify compiler flags needed to properly index your code: `-I` `-D` etc. -Each line consists of one argument to be added to the compiler command line. +`.ccls` is a line-based text file at the project root. Its specifies compiler +flags needed to properly index your code: `-I` `-D` etc. The first line +specifies the compiler driver (usually `clang`), while each subsequent lines +specifies one argument to be added to the compiler command line. + No whitespace splitting is performed on the argument, thus `-I foo` cannot be used (use `-Ifoo` or `-I\nfoo` for example). @@ -151,9 +153,10 @@ Available directives include: ### `%compile_commands.json` By default `.ccls` compiler flags are applied _only_ to files not listed in -`compile_commands.json`. If this directive appears first in `.ccls` then after -`compile_commands.json` is parsed, the rest of the `.ccls` arguments will be -_appended_ to the compiler flags for files found in `compile_commands.json`. +`compile_commands.json`. If this directive appears first in `.ccls`, the +compiler driver must be omitted. After `compile_commands.json` is parsed, the +rest of the `.ccls` arguments will be _appended_ to the compiler flags for +files found in `compile_commands.json`. ### `%c` / `%cpp` / `%objective-c` / `%objective-cpp` @@ -182,7 +185,7 @@ You may run into parsing errors like `unknown type name 'class'`. ### Compiler driver -Just use `clang` as the compiler driver (the first line unless `%compile_commands.json` is used). +Unless `%compile_commands.json` is used, you _must_ specify a "compiler driver" as the first line of your `.ccls` file. * `clang` defaults to GCCMode (gcc). It correctly treats `.c` files as C and `.cpp` files as C++. * `clang++` defaults to GXXMode (g++). It treats a `.c` file as C++ and issues a warning.