[PATCH] D119079: [llvm] [cmake] Fix finding modern ounit2

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 6 07:01:22 PST 2022


mgorny created this revision.
mgorny added reviewers: whitequark, v.g.vassilev.
mgorny requested review of this revision.
Herald added a project: LLVM.

Apparently modern versions of ounit2 can only be found as "ounit2"
rather than "oUnit" version 2.  Update the CMake check to support both
variants.  This makes the OCaml tests run again with ounit2-2.2.4.


https://reviews.llvm.org/D119079

Files:
  llvm/cmake/config-ix.cmake


Index: llvm/cmake/config-ix.cmake
===================================================================
--- llvm/cmake/config-ix.cmake
+++ llvm/cmake/config-ix.cmake
@@ -650,7 +650,12 @@
       find_ocamlfind_package(ctypes VERSION 0.4 OPTIONAL)
       if( HAVE_OCAML_CTYPES )
         message(STATUS "OCaml bindings enabled.")
-        find_ocamlfind_package(oUnit VERSION 2 OPTIONAL)
+        find_ocamlfind_package(ounit2 OPTIONAL)
+        if ( HAVE_OCAML_OUNIT2 )
+          set(HAVE_OCAML_OUNIT TRUE)
+        else()
+          find_ocamlfind_package(oUnit VERSION 2 OPTIONAL)
+        endif()
         set(LLVM_BINDINGS "${LLVM_BINDINGS} ocaml")
 
         set(LLVM_OCAML_INSTALL_PATH "${OCAML_STDLIB_PATH}" CACHE STRING


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119079.406246.patch
Type: text/x-patch
Size: 726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220206/9f65a3a8/attachment.bin>


More information about the llvm-commits mailing list