Using Merlin as a Library with ocamlbuild

I want to use Merlin as a library similar to how coq_of_ocaml and ocaml-lsp-server do but I could not figure out how to link it with OCaml build on any source. Could anyone point me in a direction?

EDIT: Sorry, this example is for dune. Did not see the ‘ocamlbuild’ requirement in OP.

I’m 90% confident GitHub - patricoferris/try-eio: Try OCaml Effects and Eio in your browser uses Merlin as a library. I’m not sure if it is the best example to study, as it also involves jsoo, codemirror, webworkers.

1 Like