[PATCH] D61402: [CMake] Detecting python modules should be cached

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 14:44:38 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL360196: [CMake] Detecting python modules should be cached (authored by cbieneman, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61402?vs=197640&id=198534#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61402/new/

https://reviews.llvm.org/D61402

Files:
  llvm/trunk/cmake/config-ix.cmake


Index: llvm/trunk/cmake/config-ix.cmake
===================================================================
--- llvm/trunk/cmake/config-ix.cmake
+++ llvm/trunk/cmake/config-ix.cmake
@@ -606,16 +606,19 @@
   string(REPLACE "." "_" module_name ${module})
   string(TOUPPER ${module_name} module_upper)
   set(FOUND_VAR PY_${module_upper}_FOUND)
+  if (DEFINED ${FOUND_VAR})
+    return()
+  endif()
 
   execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import ${module}"
     RESULT_VARIABLE status
     ERROR_QUIET)
 
   if(status)
-    set(${FOUND_VAR} 0 PARENT_SCOPE)
+    set(${FOUND_VAR} OFF CACHE BOOL "Failed to find python module '${module}'")
     message(STATUS "Could NOT find Python module ${module}")
   else()
-    set(${FOUND_VAR} 1 PARENT_SCOPE)
+  set(${FOUND_VAR} ON CACHE BOOL "Found python module '${module}'")
     message(STATUS "Found Python module ${module}")
   endif()
 endfunction()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61402.198534.patch
Type: text/x-patch
Size: 912 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190507/6500f443/attachment.bin>


More information about the llvm-commits mailing list