[llvm] fe2b2cb - Add .cmt and .cmti files for OCaml bindings

Shivam Gupta via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 07:06:05 PDT 2021


Author: TN Khanh
Date: 2021-10-05T19:36:12+05:30
New Revision: fe2b2cb58ebb57427c0a12e54a4ed63553c397ab

URL: https://github.com/llvm/llvm-project/commit/fe2b2cb58ebb57427c0a12e54a4ed63553c397ab
DIFF: https://github.com/llvm/llvm-project/commit/fe2b2cb58ebb57427c0a12e54a4ed63553c397ab.diff

LOG: Add .cmt and .cmti files for OCaml bindings

We can build .cmt and .cmti files for easier
code navigation for OCaml bindings

Added: 
    

Modified: 
    llvm/cmake/modules/AddOCaml.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/AddOCaml.cmake b/llvm/cmake/modules/AddOCaml.cmake
index 554046b20edf1..891c9e6d618c0 100644
--- a/llvm/cmake/modules/AddOCaml.cmake
+++ b/llvm/cmake/modules/AddOCaml.cmake
@@ -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"
@@ -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)


        


More information about the llvm-commits mailing list