[Lldb-commits] [PATCH] D67641: Cache PYTHON_EXECUTABLE for windows

Haibo Huang via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 17 17:01:17 PDT 2019


hhb updated this revision to Diff 220589.
hhb added a comment.

Add CACHE PATH again. I think this is the only way to go.

With PARENT_SCOPE: Tthe local detected value is always used, even if a different value is set in cache.
With no parameter: Always the value in cache is used. If a value is not set in cache, empty is used.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67641

Files:
  lldb/cmake/modules/LLDBConfig.cmake


Index: lldb/cmake/modules/LLDBConfig.cmake
===================================================================
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -250,16 +250,23 @@
   endif()
 
   # Set the same variables as FindPythonInterp and FindPythonLibs.
-  set(PYTHON_EXECUTABLE         "${PYTHON_EXECUTABLE}"          PARENT_SCOPE)
-  set(PYTHON_LIBRARY            "${PYTHON_LIBRARY}"             PARENT_SCOPE)
-  set(PYTHON_DLL                "${PYTHON_DLL}"                 PARENT_SCOPE)
-  set(PYTHON_INCLUDE_DIR        "${PYTHON_INCLUDE_DIR}"         PARENT_SCOPE)
+  set(PYTHON_EXECUTABLE         "${PYTHON_EXECUTABLE}"          CACHE PATH "")
+  set(PYTHON_LIBRARY            "${PYTHON_LIBRARY}"             CACHE PATH "")
+  set(PYTHON_DLL                "${PYTHON_DLL}"                 CACHE PATH "")
+  set(PYTHON_INCLUDE_DIR        "${PYTHON_INCLUDE_DIR}"         CACHE PATH "")
   set(PYTHONLIBS_VERSION_STRING "${PYTHONLIBS_VERSION_STRING}"  PARENT_SCOPE)
   set(PYTHON_VERSION_STRING     "${PYTHON_VERSION_STRING}"      PARENT_SCOPE)
   set(PYTHON_VERSION_MAJOR      "${PYTHON_VERSION_MAJOR}"       PARENT_SCOPE)
   set(PYTHON_VERSION_MINOR      "${PYTHON_VERSION_MINOR}"       PARENT_SCOPE)
   set(PYTHON_VERSION_PATCH      "${PYTHON_VERSION_PATCH}"       PARENT_SCOPE)
 
+  mark_as_advanced(
+    PYTHON_EXECUTABLE
+    PYTHON_LIBRARY
+    PYTHON_DLL
+    PYTHON_INCLUDE_DIR
+  )
+
   message(STATUS "LLDB Found PythonExecutable: ${PYTHON_EXECUTABLE} (${PYTHON_VERSION_STRING})")
   message(STATUS "LLDB Found PythonLibs: ${PYTHON_LIBRARY} (${PYTHONLIBS_VERSION_STRING})")
   message(STATUS "LLDB Found PythonDLL: ${PYTHON_DLL}")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67641.220589.patch
Type: text/x-patch
Size: 1686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190918/6f43e775/attachment-0001.bin>


More information about the lldb-commits mailing list