Version française
Home     About     Download     Resources     Contact us    
Browse thread
specify include directories with ocamlbuild
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] specify include directories with ocamlbuild
On Tue, 24 Aug 2010 09:31:52 +0200, Hendrik Tews <tews@os.inf.tu-dresden.de> wrote:
> Hi,
Hi,

> in 3.11 I used
> 
>    <some_file.ml>: I(+camlp4/Camlp4Parsers)
> 
> in _tags to specify that ocamlbuild should add 
> -I +camlp4/Camlp4Parsers when compiling some_file. In 3.12 this
> gives 
> 
>     Warning: tag "I" does not expect a parameter, but is used with parameter "+camlp4/Camlp4Parsers"
> 
> What is the recommended way to specify an include directory in
> 3.12?

Can you try to have the following declaration in your myocamlbuild.ml

pflag ["ocaml"] "I" (fun x -> S[A"-I"; A x])

The syntax foo(bar) was implicitely turned into arguments "-foo bar"
for commands involving the matched files, however this was too much
specific (the "-" thing) and too much coarse grained. Indeed there
was no way to choose when to add this flag (linking, compiling,
pre-processing, building doc...).

This is now possible with thes parameterized flags, and almost backward
compatible since we added default pflags:
  pp(_), for-pack(_), inline(_), package(_), predicate(_), syntax(_)

However we didn't thought about I(_)...

-- 
Nicolas Pouillard
http://nicolaspouillard.fr