description = "A visitor generation facility"
requires = "compiler-libs ppx_tools ppx_deriving"

# I don't really understand any of the following.
# See https://github.com/whitequark/ppx_deriving

package "ppx" (
  description = "Compile-time support for generating visitors"
  requires(-ppx_driver) = "ppx_deriving"
  ppxopt(-ppx_driver) = "ppx_deriving,./ppx_deriving_visitors.cma"

# It seems OK to let this package exist unconditionally.
#   exists_if = "ppx_deriving_visitors.cma"

# Apparently the following part could be omitted too.
# It affects ppx driver compilation, whatever that means.
  requires(ppx_driver) = "ppx_deriving.api"
  archive(ppx_driver, byte) = "ppx_deriving_visitors.cma"
  archive(ppx_driver, native) = "ppx_deriving_visitors.cmxa"

)

# The runtime support library.

package "runtime" (
  description = "Runtime support for the generated visitors"
  archive(byte) = "VisitorsRuntime.cma"
  archive(native) = "VisitorsRuntime.cmxa"
)
