Skip to content

Commit 095f086

Browse files
committed
[docs] Clarify compile_flags.txt subtleties
See confusion e.g. in clangd/clangd#637
1 parent be997ce commit 095f086

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

clang/docs/JSONCompilationDatabase.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,18 @@ to parse C++ code in the source tree.
9494

9595
Alternatives
9696
============
97-
For simple projects, Clang tools also recognize a compile_flags.txt file.
98-
This should contain one flag per line. The same flags will be used to compile
99-
any file.
97+
For simple projects, Clang tools also recognize a ``compile_flags.txt`` file.
98+
This should contain one argument per line. The same flags will be used to
99+
compile any file.
100+
101+
Example:
102+
103+
::
104+
105+
-xc++
106+
-I
107+
libwidget/include/
108+
109+
Here ``-I libwidget/include`` is two arguments, and so becomes two lines.
110+
Paths are relative to the directory containing ``compile_flags.txt``.
111+

0 commit comments

Comments
 (0)