[PATCH] D35898: [OCaml] Respect CMAKE_C_COMPILER & CMAKE_C_FLAGS for OCaml C files

JacquesPa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 28 07:47:26 PDT 2017


jpdeplaix accepted this revision.
jpdeplaix added a comment.
This revision is now accepted and ready to land.

Seems fair.

The -DNDEBUG related problem is a bit annoying when using the OCAML_LLVM_OUT_OF_TREE flag, but maybe we should forbid to have this flag and to be in Debug mode like this ?

  diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
  index 1b805c0710a..31aca43bc2f 100644
  --- a/cmake/modules/AddOCaml.cmake
  +++ b/cmake/modules/AddOCaml.cmake
  @@ -174,6 +174,8 @@ function(add_ocaml_library name)
       foreach( llvm_lib ${llvm_libs} )
         add_dependencies("ocaml_${name}" "${llvm_lib}")
       endforeach()
  +  elseif( uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
  +    message(FATAL_ERROR "LLVM_OCAML_OUT_OF_TREE cannot be enabled while on Debug mode. Use -DCMAKE_BUILD_TYPE=Release instead.")
     endif()
   
     add_dependencies("ocaml_all" "ocaml_${name}")


https://reviews.llvm.org/D35898





More information about the llvm-commits mailing list