Loading ...
Sorry, an error occurred while loading the content.

Supplying preprocessors to ocamlbuild

Expand Messages
  • Jason Yeo
    Hi, I m having problems with ocamlbuild. I have successfully built deriving (https://github.com/jaked/deriving) and I am manually linking it to my project.
    Message 1 of 1 , Mar 17 11:10 AM
    • 0 Attachment
      Hi,

      I'm having problems with ocamlbuild.

      I have successfully built deriving (https://github.com/jaked/deriving) and
      I am manually linking it to my project. This is the ocamlbuild command that
      I am executing:

      ocamlbuild -no-links -pp camlp4of.opt,deriving -libs dynlink,camlp4lib
      -cflags -I,+camlp4,-I,deriving_lib,-dtypes -lflags
      -I,+camlp4,-I,deriving_lib,-dtypes -lexflag -q -yaccflag -v -j 0
      sPL_compile.byte

      The -pp camlp4of.opt,deriving part isn't working for me. I've no idea
      what's the syntax to supply two preprocessors to the command. I've tried -pp
      camlp4of.opt -pp deriving and -pp camlp4of.opt deriving but both doesn't
      work.

      -pp camlp4of.opt -pp deriving produces this when ocamlbuild tries to invoke
      ocamldep:

      ocamldep.opt -pp 'camlp4of.opt deriving' -modules sPL_compile.ml >
      sPL_compile.ml.depends
      Error: don't know what to do with deriving

      While -pp camlp4of.opt deriving produces this:

      Solver failed:
      Ocamlbuild knows of no rules that apply to a target named deriving. This
      can happen if you ask Ocamlbuild to build a target with the wrong extension
      (e.g. .opt instead of .nati\
      ve) or if the source files live in directories that have not been specified
      as include directories.
      Backtrace:
      - Failed to build the target deriving
      - Building deriving

      Does anyone know what's the syntax to pass multiple preprocessors to
      ocamlbuild?

      Thanks,
      Jason


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.