Fix for #20408 - CMake LLVM_ENABLE_FFI=ON build fails on reconfigure

Josh Klontz josh.klontz at gmail.com
Wed Jul 23 06:11:38 PDT 2014


Testing for the presence of FFI_INCLUDE_PATH cache variable is incorrect if
cmake is run a second time.

Hopefully this can be applied to 3.5 branch as well. Thanks!
-Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140723/51105730/attachment.html>
-------------- next part --------------
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index b862ceb..2976238 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -258,12 +258,12 @@ endif ()
 
 if( LLVM_ENABLE_FFI )
   find_path(FFI_INCLUDE_PATH ffi.h PATHS ${FFI_INCLUDE_DIR})
-  if( FFI_INCLUDE_PATH )
+  if( EXISTS "${FFI_INCLUDE_PATH}/ffi.h" )
     set(FFI_HEADER ffi.h CACHE INTERNAL "")
     set(HAVE_FFI_H 1 CACHE INTERNAL "")
   else()
     find_path(FFI_INCLUDE_PATH ffi/ffi.h PATHS ${FFI_INCLUDE_DIR})
-    if( FFI_INCLUDE_PATH )
+    if( EXISTS "${FFI_INCLUDE_PATH}/ffi/ffi.h" )
       set(FFI_HEADER ffi/ffi.h CACHE INTERNAL "")
       set(HAVE_FFI_FFI_H 1 CACHE INTERNAL "")
     endif()


More information about the llvm-commits mailing list