From: "Stéphane Glondu" <steph@glondu.net>
To: Renald Buter <buter@cwts.leidenuniv.nl>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] ocamlbuild: simplification of invocation
Date: Mon, 16 Jun 2008 13:00:43 +0200 [thread overview]
Message-ID: <485647DB.3020107@glondu.net> (raw)
In-Reply-To: <48562D5F.80407@cwts.leidenuniv.nl>
Renald Buter a écrit :
> [...]
> To build this, I have to enter:
>
> ocamlbuild -cflags -I,+oUnit -lflags -I,+oUnit -libs unix,oUnit
> test_setup.native
>
> Now, is there any way of simplifying this? I've tried looking into the
> tags for the _tags file, but got confused...
You can make a plugin which sets these options by putting the following
lines in a file named myocamlbuild.ml at the root of your project:
--8<----------
open Ocamlbuild_plugin;;
dispatch begin function
| Before_options ->
Options.ocaml_cflags := [ "-I"; "+oUnit"];
Options.ocaml_lflags := [ "-I"; "+oUnit"];
Options.ocaml_libs := [ "unix"; "oUnit"];
| _ -> ()
end;;
--8<----------
Then you can just invoke "ocamlbuild test_setup.native".
Cheers,
--
Stéphane Glondu
next prev parent reply other threads:[~2008-06-16 11:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-16 9:07 Renald Buter
2008-06-16 11:00 ` Stéphane Glondu [this message]
2008-06-16 11:48 ` [Caml-list] " Renald Buter
2008-06-16 12:02 ` Stéphane Glondu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=485647DB.3020107@glondu.net \
--to=steph@glondu.net \
--cc=buter@cwts.leidenuniv.nl \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox