Skip to content

Support jbuilder and ppx_driver

Compare
Choose a tag to compare
@avsm avsm released this 30 Mar 11:22

Distribute the PPX extension so that it is compatible with Jbuilder.
ppx_cstruct is now distributed as both a library and a binary.
Findlib predicates are used to distinguish usage:

  • the binary is used for toplevel and simple -ppx building
  • the library is used for linking custom rewriters
  • -package cstruct.ppx alone uses the binary for rewriting.
  • -package cstruct.ppx -predicates custom_ppx,ppx_driver" is used to link the rewriter.

To use the PPX extension in jbuilder, just add:

  (libraries (cstruct))
  (preprocess (pps (cstruct.ppx)))

to your jbuild file. This may be renamed to ppx_cstruct in a
future release so that the PPX dependency is decoupled from the main
library, so this cstruct.ppx is intended to be transitional as it
is what was originally used.