package dune-compiledb
Generate compile_commands.json from dune rules
Install
Dune Dependency
Authors
Maintainers
Sources
dune-compiledb-0.6.0.tbz
sha256=f5e74fd4c2af89df731f53832d8388592d44fed9f50d6d82ba8f71ea1e8ff9ff
sha512=74e50c759ef50ce13d0f1a424f91176f1327349d6c1b97d0a20c848417920c1490ff7d5a8cabc541b1409a6a6e488f807e34c3cf7ac0d9866938bd43eab08de8
README.md.html
README.md
Dune-compiledb
— generate compile_commands.json
The compile_commands.json
is used by language servers like clangd
to determine what flags to use when analysing C source code. It is also used by static analysers such as goblint
to determine how to preprocess C files.
Using the correct include flags is important, otherwise the <caml/...>
headers won't be found by these tools.
Installation
opam install dune-compiledb
Requires OCaml 4.08+ and Dune 2.7+.
Usage
Run this to create a compile-commands.json
:
dune rules | dune-compiledb
Now clangd
integration with your editor should work.
Alternatives
bear can be used if your project doesn't have header files generated at build time:
dune clean && bear -- dune build @check --cache=disabled
However, the generated compile_commands.json
lacks the -iquote
flag and clangd
won't be able to find the generated header files (if any).
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>