Skip to content

Dune: using both cppo and a ppx #86

@phstrauss

Description

@phstrauss

Hello,
I'm trying to use both cppo and logs-ppx preprocessing in my dune file, I've read:

https://github.com/ocaml-community/cppo
https://dune.readthedocs.io/en/stable/quick-start.html#using-cppo
ocaml/dune#171
ocsigen/lwt#411
ocaml/dune#7373

but can't get a solution, could you help me? I'm using latest opam with ocaml 5.0.0.
Thanks.

My latest poor attempt is:

(rule
((targets (globals.ml))
(deps (globals.cppo.ml))
(action (run ${bin:cppo} ${<} -o ${@}))))

(rule
((targets (plot2d.ml))
(deps (plot2d.cppo.ml))
(action (run ${bin:cppo} ${<} -o ${@}))))

(executables
(names eqfrex)
(libraries dspml plwrap lablgtk3 cairo2 plplot plcairo react logs logs.fmt)
(preprocess
(pps logs-ppx)
)
(modes (native exe) (byte exe))
)

Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions