Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oasis build configuration with subdirectories

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?

like image 762
lambda.xy.x Avatar asked Feb 11 '23 00:02

lambda.xy.x


1 Answers

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.

like image 68
ivg Avatar answered Feb 19 '23 05:02

ivg