Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Forced linking and Ocamlbuild
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-04-05 (15:08)
From: Dario Teixeira <darioteixeira@y...>
Subject: Forced linking and Ocamlbuild

I'm using Ocamlbuild with the findlib plugin listed on the Wiki.
In this setting, how does one force a given module to always be
linked into the final executable, even if it's not referenced
anywhere?  (I realise there's always the option of adding a
dummy reference, but I'm looking for a cleaner solution).

Note that the package is of course listed under "true" in the
top-level _tags file, but it's being pruned out from the actual
invocation of ocamlfind.  Normally this is a sensible approach,
but in this case I want to force linking.  Also, I've searched
into the (long) list of built-in tags, but couldn't find anything
resembling this purpose.

While I can of course explicitly change the myocamlbuild plugin
so that invocations of the compiler always append the module I
want to link, I wonder if there's not already a cleaner, more
general solution that I may have missed.

Thanks in advance!
Best regards,
Dario Teixeira