mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-21 15:15:07 +00:00
Rename clang_args to .cquery
This commit is contained in:
parent
7923b5d219
commit
87f6452b5d
18
README.md
18
README.md
@ -65,30 +65,24 @@ If you run into issues, you can view debug output by running the
|
||||
|
||||
## Project setup
|
||||
|
||||
### compile_commands.json (Best)
|
||||
### `compile_commands.json` (Best)
|
||||
|
||||
To get the most accurate index possible, you can give cquery a compilation
|
||||
database emitted from your build system of choice. For example, here's how to
|
||||
generate one in ninja. When you sync your code you should regenerate this file.
|
||||
|
||||
```bash
|
||||
$ ninja -C out/Release -t compdb cxx cc > compile_commands.json
|
||||
```
|
||||
See [wiki](https://github.com/jacobdufault/cquery/wiki) for how to generate `compile_commands.json` with CMake, Build EAR, Ninja, ...
|
||||
|
||||
If the `compile_commands.json` is not in the top-level workspace directory,
|
||||
then the `cquery.misc.compilationDatabaseDirectory` setting can be used to
|
||||
specify its location.
|
||||
|
||||
### cquery.index.extraClangArguments
|
||||
### `cquery.index.extraClangArguments`
|
||||
|
||||
If for whatever reason you cannot generate a `compile_commands.json` file, you
|
||||
can add the flags to the `cquery.index.extraClangArguments` configuration
|
||||
option.
|
||||
|
||||
### clang_args
|
||||
### `.cquery`
|
||||
|
||||
If for whatever reason you cannot generate a `compile_commands.json` file, you
|
||||
can add the flags to a file called `clang_args` located in the top-level
|
||||
can add the flags to a file called `.cquery` located in the top-level
|
||||
workspace directory.
|
||||
|
||||
Each argument in that file is separated by a newline. Lines starting with `#`
|
||||
@ -128,7 +122,7 @@ exclude v8, webkit, and third_party, it goes down to about 6.5gb.
|
||||
|
||||
# Wiki
|
||||
|
||||
There are some additional tips on the [wiki](https://github.com/jacobdufault/cquery/wiki).
|
||||
For Emacs/Vim/other editors integration and some additional tips, see [wiki](https://github.com/jacobdufault/cquery/wiki).
|
||||
|
||||
# Chromium tips
|
||||
|
||||
|
@ -3250,7 +3250,7 @@ int main(int argc, char** argv) {
|
||||
When opening up a directory, cquery will look for a compile_commands.json
|
||||
file emitted by your preferred build system. If not present, cquery will
|
||||
use a recursive directory listing instead. Command line flags can be
|
||||
provided by adding a "clang_args" file in the top-level directory. Each
|
||||
provided by adding a file named `.cquery` in the top-level directory. Each
|
||||
line in that file is a separate argument.
|
||||
|
||||
There are also a number of configuration options available when
|
||||
|
@ -203,7 +203,7 @@ std::vector<Project::Entry> LoadFromDirectoryListing(ProjectConfig* config) {
|
||||
std::vector<std::string> args;
|
||||
std::cerr << "Using arguments: ";
|
||||
for (const std::string& line :
|
||||
ReadLines(config->project_dir + "/clang_args")) {
|
||||
ReadLines(config->project_dir + "/.cquery")) {
|
||||
if (line.empty() || StartsWith(line, "#"))
|
||||
continue;
|
||||
if (!args.empty())
|
||||
|
@ -36,7 +36,7 @@ struct Project {
|
||||
// |root_directory| contains a compile_commands.json file, that one will be used
|
||||
// instead. Otherwise, a recursive directory listing of all *.cpp, *.cc, *.h,
|
||||
// and *.hpp files will be used. clang arguments can be specified in a
|
||||
// clang_args file located inside of |root_directory|.
|
||||
// .cquery file located inside of |root_directory|.
|
||||
void Load(const std::vector<std::string>& extra_flags,
|
||||
const std::string& opt_compilation_db_dir,
|
||||
const std::string& root_directory,
|
||||
|
Loading…
Reference in New Issue
Block a user