Skip to content

Commit

Permalink
Add .cmt and .cmti files for OCaml bindings
Browse files Browse the repository at this point in the history
We can build .cmt and .cmti files for easier
code navigation for OCaml bindings
  • Loading branch information
tnkhanh authored and xgupta committed Oct 5, 2021
1 parent 3f9b235 commit fe2b2cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion llvm/cmake/modules/AddOCaml.cmake
Expand Up @@ -103,6 +103,9 @@ function(add_ocaml_library name)
list(APPEND ocaml_inputs "${bin}/${ocaml_file}.mli" "${bin}/${ocaml_file}.ml")

list(APPEND ocaml_outputs "${bin}/${ocaml_file}.cmi" "${bin}/${ocaml_file}.cmo")

list(APPEND ocaml_outputs "${bin}/${ocaml_file}.cmti" "${bin}/${ocaml_file}.cmt")

if( HAVE_OCAMLOPT )
list(APPEND ocaml_outputs
"${bin}/${ocaml_file}.cmx"
Expand Down Expand Up @@ -152,7 +155,8 @@ function(add_ocaml_library name)

add_custom_command(
OUTPUT ${ocaml_outputs}
COMMAND "${OCAMLFIND}" "ocamlmklib" "-o" "${name}" ${ocaml_flags} ${ocaml_params}
COMMAND "${OCAMLFIND}" "ocamlmklib" "-ocamlcflags" "-bin-annot"
"-o" "${name}" ${ocaml_flags} ${ocaml_params}
DEPENDS ${ocaml_inputs} ${c_outputs}
COMMENT "Building OCaml library ${name}"
VERBATIM)
Expand Down

0 comments on commit fe2b2cb

Please sign in to comment.