alan-j-hu / llvm-dune

The official LLVM OCaml binding but built using dune
Other
26 stars 3 forks source link

Add support for extra_deps, needed for llvm_ocaml.h #4

Closed jberdine closed 2 years ago

jberdine commented 3 years ago

In LLVM main, there is now a llvm/bindings/ocaml/llvm/llvm_ocaml.h file. The creation of static and shared directories performed by setup.sh breaks #include "llvm_ocaml.h". This patch works around this by adding support for adding extra_deps to the generated dune files for llvm_ocaml.h, and adds some -I flags to find it.

I make no claims that this is a good solution.

jberdine commented 3 years ago

Also, the new header file will be included, I think, only starting with LLVM 13.

kit-ty-kate commented 2 years ago

Sorry for all the time it took me to come back to llvm..

I used a different solution by simply always copying llvm_ocaml.h so that we don't have any maintenance cost in the future.

See: https://github.com/kit-ty-kate/llvm-dune/commit/7512ef851a08ff276e1353e661097d6e9f20ca89

However upon testing: