In my dune
project, besides my lib
directory I have a debugging
directory containing just one ml file, called debug_me.ml
.
In the (relatively infrequent) occasions when I need to do some debugging, I put the relevant piece of code in debug_me.ml
, and then compile it (along with all its dependencies in the lib
directory) with the -g
option, and finally link them into an executable that can then be given as argument to ocamldebug
.
I would like to write the dune file in that debugging
directory so that invoking dune build debugging
(or some equally simple command) will do exactly the set of actions I described in the preceding paragraph (after having put the code in debug_me.ml
, that is ; this part I do myself by hand).
All I can think of so far is the following :
(executable
(libraries lib)
)
But I don’t know how to tell dune
to compile the modules in lib
with the -g
option. A search for ocamldebug
in the dune
manual gave no results.