Skip to content

Commit b413168

Browse files
Kennet Postigochenglou
authored andcommitted
More docs on adding dependencies (#28)
Adds build step changes and merlin changes when adding a dependency.
1 parent 5133b8f commit b413168

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,22 @@ of `opam` packages in the [opam repository](http://opam.ocaml.org/packages/).
4242
Edit your `opam` file so that you depend on a particular opam package and range
4343
of versions.
4444

45+
In addition you may have to tweak the buildstep to recognize the dependency, by changing `build.ml` within the `pkg` folder. and add the following for you dependency:
46+
```ocaml
47+
...
48+
OS.Cmd.run @@ Cmd.(
49+
ocamlbuild % "-use-ocamlfind"
50+
%% (v "-I" % "src")
51+
%% (v "-pkg" % "[PACKAGE]") (* <---- only change is this line*)
52+
%% of_list files)
53+
...
54+
```
55+
56+
Finally For your editor to pick up the dependency and fancy autocomplete etc. make sure to add the package in your `.merlin` file:
57+
```ocaml
58+
PKG topkg reason [PACKAGE]
59+
```
60+
4561
### Creating Libraries
4662

4763
See the [OPAM instructions](https://opam.ocaml.org/doc/Packaging.html).

0 commit comments

Comments
 (0)