package dune-compiledb

All checked builds pass
  1. Overview
  2. Docs
Generate compile_commands.json from dune rules

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dune-compiledb-0.6.0.tbz
sha256=f5e74fd4c2af89df731f53832d8388592d44fed9f50d6d82ba8f71ea1e8ff9ff
sha512=74e50c759ef50ce13d0f1a424f91176f1327349d6c1b97d0a20c848417920c1490ff7d5a8cabc541b1409a6a6e488f807e34c3cf7ac0d9866938bd43eab08de8

Description

Generates a compile_commands.json from dune rules that can be used by language server like 'clangd', or static analyzers like 'goblint'. Works with generated headers.

Added to opam-repository:

README

Build and test OCaml-CI Build Status

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).

Dependencies (6)

  1. fpath >= "0.7.1"
  2. sexplib0
  3. sexplib
  4. ezjsonm >= "1.0.0"
  5. ocaml >= "4.08"
  6. dune >= "2.7"

Dev Dependencies (1)

  1. odoc with-doc

Optional Dependencies

None

Used by (5)

  1. lintcstubs
  2. pcre >= "8.0.5"
  3. pcre2 >= "8.0.4"
  4. postgresql >= "5.3.2"
  5. sqlite3 >= "5.4.0"

Conflicts

None

Build status

Results of building dune-compiledb with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.6.0 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure