Hello,

I'm not exactly sure this is a complete answer to your problem (I'm not familiar with plugin linking and all that), but here is a small test:

a.ml:
let () = print_endline "I'm 'a'!"

b.ml:
let () = print_endline "I'm 'b'!"

myocamlbuild.ml:
open Ocamlbuild_plugin

let _ = dispatch begin function
  | After_rules ->
    dep ["use_b"] ["b.cmo"]
  | _ -> ()
end

I i run "ocamlbuild a.byte", then executing a.byte will only print "I'm 'a'!".

If I add the following _tags:
  "a.byte": use_b

Then a.byte will print both "I'm 'a'!" and "I'm 'b'!".

I don't know the exact semantics of this 'dispatch' function (After_rules, etc.), I just imitated it from an other project doing a similar thing. I suppose you could find more detailed answers in the ocamlbuild documentation.

Hope it helps.

On Fri, May 6, 2011 at 4:34 PM, Dario Teixeira <darioteixeira@yahoo.com> wrote:
Hi,

I have a couple of plugin modules (say, "Foo.ml" and "Bar.ml") which become
known to the main programme solely because they register themselves upon
initialisation.  However, because there is no implicit dependency between
the main programme and these plugins, when compiling with Ocamlbuild they
are not linked in.  So what's the cleanest way of telling Ocamlbuild that
these plugins should also be compiled and linked together with the main
programme?

Thanks in advance!
Dario



--
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs