I am using oasis to build my ocaml project, with the source code present in a directory called src. The oasis build file looks like that:
OASISFormat: 0.4
Name: Test
Version: 0.1
Synopsis: no
Authors: Me
License: BSD-3-clause
Plugins: META (0.4)
Executable abc
Path: src
BuildTools: ocamlbuild
MainIs: main.ml
Now I would like to organize the files into subfolders, putting a.mli and a.ml into src/util. After doing this, the module becomes invisible to ocamlbuild/ocamlc, resulting in an 'unbound module A' error. If I would call ocamlc by hand, I can add the -I src/util flag to make a.mli visible again.
How can I add the additional paths to the oasis configuration without making the files full libraries?
It is impossible with oasis, you need to modify your _tags
file, but I wouldn't advice you to do this. The general approach is to create Library
entries in your oasis file. This helps to keep your project structure clean. And if you wouldn't like to create a library from utils, then why bother and move it into a subfolder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With