Le 20 juil. 2011 à 14:48, Guillaume Hennequin a écrit :

> Hello,
> 
> I came across two ocamlbuild issues today:
> 
> 1) how can one give a cflag that requires an argument, like
>    ocamlbuild -cflag -inline 2 target.native
>   Backtrace:
>    - failed to build the target 2

To overcome this problem you can execute either
        ocamlbuild -cflag -inline -cflag 2 target.native
or
        ocamlbuild -cflags -inline,2 target.native


> 2) I don't understand why ocamlbuild target.cmx would need to compile
> target.cmo on the way... this actually prevents me from using any of the
> ocamlopt-specific flags:
>    ocamlbuild -cflag -S target.cmx
>    (ocamlc itself complains it doesn't have a -S option)
> 
> any way around that?

This is a reported bug [1]; in your case, a workaround is to write the
following "myocamlbuild.ml" file:
        open Ocamlbuild_plugin

        let () =
          dispatch begin function
            | After_rules ->
                tag_file "target.ml" ["myoption"];
                flag ["ocaml"; "compile"; "native"; "myoption"] (A"-S");
            | _ -> ()
          end


Hope this helps,

Xavier Clerc


[1] http://caml.inria.fr/mantis/view.php?id=5282

-- 
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

Reply via email to