Version française
Home     About     Download     Resources     Contact us    
Browse thread
Working on dependent projects with ocamlbuild
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Working on dependent projects with ocamlbuild
Hello,

I'm now trying to do something a little bit more complex but fail to  
solve it in the simple way I mentionned (maybe it is not possible). I  
still have the same setup of two independent projects each depending  
on a base project.

base/src
p1/src
p2/src

The base project is structured as follows :

base/src/a.ml
base/src/b.ml
base/src/base.ml
base/src/base.mli

with base.ml as follows

module A = A
module B = B
val ...

The idea is that b.ml can access things in a.ml that users of the  
base project should not access. What I used to do is to  
appropriatlely constrain the signatures of A and B in base.mli and  
then create in a directory :

dest/base.cma (containing a.cmo b.cmo base.cmo)
dest/base.cmi
dest/base.mli

Thus forcing access to A and B via the constrained signature Base.A  
and Base.B.

But if I use the approach mentionned in my initial posting users of  
base will see the unconstrained a.cmi and b.cmi. Is there a way that  
allows me to use this approach while maintaining the abstraction I  
get with cma's ? Even if it means plugins in p1 and p2 ? I have the  
impression that the response is negative because even if I try to  
build a .cma with a mllib the build directory with have all .cmi and  
the compilers will look at them.

Thanks for your answers,

Daniel