diff options
author | Sam McCall <sam.mccall@gmail.com> | 2017-11-09 10:37:39 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2017-11-09 10:37:39 +0000 |
commit | 60d74e45888e2bab27bb003193e22acbc754c67a (patch) | |
tree | 9baa5df06875c7505fdf2c80a85cf71d4d0382e7 /clang/docs/JSONCompilationDatabase.rst | |
parent | 26d55e0346964a46978c873b4d4bde01df4ea977 (diff) | |
download | bcm5719-llvm-60d74e45888e2bab27bb003193e22acbc754c67a.tar.gz bcm5719-llvm-60d74e45888e2bab27bb003193e22acbc754c67a.zip |
[Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found.
Summary:
This is an alternative to JSONCompilationDatabase for simple projects that
don't use a build system such as CMake.
(You can also drop one in ~, to make your tools use e.g. C++11 by default)
There's no facility for varying flags per-source-file or per-machine.
Possibly this could be accommodated backwards-compatibly using cpp, but even if
not the simplicity seems worthwhile for the cases that are addressed.
Tested with clangd, works great! (requires clangd restart)
Reviewers: klimek
Subscribers: ilya-biryukov, cfe-commits
Differential Revision: https://reviews.llvm.org/D39799
llvm-svn: 317777
Diffstat (limited to 'clang/docs/JSONCompilationDatabase.rst')
-rw-r--r-- | clang/docs/JSONCompilationDatabase.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/docs/JSONCompilationDatabase.rst b/clang/docs/JSONCompilationDatabase.rst index 8631e8365ce..1f3441b033d 100644 --- a/clang/docs/JSONCompilationDatabase.rst +++ b/clang/docs/JSONCompilationDatabase.rst @@ -91,3 +91,9 @@ The convention is to name the file compile\_commands.json and put it at the top of the build directory. Clang tools are pointed to the top of the build directory to detect the file and use the compilation database to parse C++ code in the source tree. + +Alternatives +============ +For simple projects, Clang tools also recognize a compile_flags.txt file. +This should contain one flag per line. The same flags will be used to compile +any file. |