[clang] 095f086 - [docs] Clarify compile_flags.txt subtleties
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 31 02:17:32 PST 2021
Author: Sam McCall
Date: 2021-01-31T11:16:59+01:00
New Revision: 095f08653f3ab0917a474888abac95c4fa99697d
URL: https://github.com/llvm/llvm-project/commit/095f08653f3ab0917a474888abac95c4fa99697d
DIFF: https://github.com/llvm/llvm-project/commit/095f08653f3ab0917a474888abac95c4fa99697d.diff
LOG: [docs] Clarify compile_flags.txt subtleties
See confusion e.g. in https://github.com/clangd/clangd/issues/637
Added:
Modified:
clang/docs/JSONCompilationDatabase.rst
Removed:
################################################################################
diff --git a/clang/docs/JSONCompilationDatabase.rst b/clang/docs/JSONCompilationDatabase.rst
index b5766402e2d6..bd91db258398 100644
--- a/clang/docs/JSONCompilationDatabase.rst
+++ b/clang/docs/JSONCompilationDatabase.rst
@@ -94,6 +94,18 @@ 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.
+For simple projects, Clang tools also recognize a ``compile_flags.txt`` file.
+This should contain one argument per line. The same flags will be used to
+compile any file.
+
+Example:
+
+::
+
+ -xc++
+ -I
+ libwidget/include/
+
+Here ``-I libwidget/include`` is two arguments, and so becomes two lines.
+Paths are relative to the directory containing ``compile_flags.txt``.
+
More information about the cfe-commits
mailing list