[OCaml] [cmake] Disable OCaml bindings if ctypes >=0.3 is not found.
authorPeter Zotov <whitequark@whitequark.org>
Wed, 3 Dec 2014 03:39:01 +0000 (03:39 +0000)
committerPeter Zotov <whitequark@whitequark.org>
Wed, 3 Dec 2014 03:39:01 +0000 (03:39 +0000)
llvm-svn: 223195

llvm/cmake/config-ix.cmake

index abee8b6..f806d9c 100755 (executable)
@@ -529,10 +529,14 @@ else()
     if( OCAML_VERSION VERSION_LESS "4.00.0" )
       message(STATUS "OCaml bindings disabled, need OCaml >=4.00.0.")
     else()
-      message(STATUS "OCaml bindings enabled.")
-      find_ocamlfind_package(ctypes VERSION 0.3)
-      find_ocamlfind_package(oUnit VERSION 2 OPTIONAL)
-      set(LLVM_BINDINGS "${LLVM_BINDINGS} ocaml")
+      find_ocamlfind_package(ctypes VERSION 0.3 OPTIONAL)
+      if( HAVE_OCAML_CTYPES )
+        message(STATUS "OCaml bindings enabled.")
+        find_ocamlfind_package(oUnit VERSION 2 OPTIONAL)
+        set(LLVM_BINDINGS "${LLVM_BINDINGS} ocaml")
+      else()
+        message(STATUS "OCaml bindings disabled, need ctypes >=0.3.")
+      endif()
     endif()
   endif()
 endif()