Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 521

Use C binding with PPX and dune

$
0
0

Hi,
I’m trying to write a ppx-rewriter for my library. The issue is that my library need to get the flags for the C++ bindings I’m using. When I import my library in an example with the following dune, it works:

(executable
  (name main)
  (flags (:standard -w -49
                    -cclib -lstdc++
                    -cclib -lraplcap-msr
                    -cclib -lsmartgauge
                    -cclib -lusb-1.0
                    -cclib -lmammut))
  (libraries tezos_oxymeter))

However, when I try to import it into my ppx, dune says it can’t reach the library. Could this be an error related to the fact that it’s in a ppx ?

This is my dune for the ppx declaration:

(library
  (public_name ppx-tezos_oxymeter)
  (name ppx_oxymeter)
  (kind ppx_rewriter)
  (libraries tezos_oxymeter ppxlib)
  (modules ppx_oxymeter)
  (flags (:standard -w -49 -linkall
                    -cclib -lstdc++
                    -cclib -lraplcap-msr
                    -cclib -lsmartgauge
                    -cclib -lusb-1.0
                    -cclib -lmammut))
  (preprocess (pps ppxlib.metaquot)))

Does someone have ever encountered this problem and find a solution to solve it?

13 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 521

Trending Articles