package dune-compiledb
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Generate compile_commands.json from dune rules
Install
dune-project
Dependency
Authors
Maintainers
Sources
dune-compiledb-0.5.0.tbz
sha256=fb91db789db4c25e6339d955158fa227cb9547279f4e35acd132e715889686ca
sha512=59c8b94fb1270b7fe5c315eedb26da8d9b6041f64e6863571eb550420c17dd6b5a8b042dff9c934c2f0e4e43dff8912f4cbda007bce5de1a22c27b931ffa6509
doc/README.html
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-compiledbRequires OCaml 4.08+ and Dune 2.7+.
Usage
Run this to create a compile-commands.json:
dune rules | dune-compiledbNow 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=disabledHowever, 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)"
>