clang-tools
11.0.0
|
Conditions in the CompileFlags block affect how a file is parsed. More...
#include <ConfigFragment.h>
Public Attributes | |
std::vector< Located< std::string > > | Add |
List of flags to append to the compile command. More... | |
std::vector< Located< std::string > > | Remove |
List of flags to remove from the compile command. More... | |
Conditions in the CompileFlags block affect how a file is parsed.
clangd emulates how clang would interpret a file. By default, it behaves roughly like clang $FILENAME
, but real projects usually require setting the include path (with the -I
flag), defining preprocessor symbols, configuring warnings etc. Often, a compilation database specifies these compile commands. clangd searches for compile_commands.json in parents of the source file.
This section modifies how the compile command is constructed.
Definition at line 130 of file ConfigFragment.h.
std::vector<Located<std::string> > clang::clangd::config::Fragment::CompileFlagsBlock::Add |
List of flags to append to the compile command.
Definition at line 132 of file ConfigFragment.h.
std::vector<Located<std::string> > clang::clangd::config::Fragment::CompileFlagsBlock::Remove |
List of flags to remove from the compile command.
In all cases, -Xclang is also removed where needed.
Example: Command: clang++ –include-directory=/usr/include -DFOO=42 foo.cc Remove: [-I, -DFOO=*] Result: clang++ foo.cc
Flags added by the same CompileFlags entry will not be removed.
Definition at line 150 of file ConfigFragment.h.