[debuginfo-tests] 309f9a1 - [debuginfo-tests] Don't look for Python 3 if we already have it
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 1 11:25:03 PDT 2019
Author: Reid Kleckner
Date: 2019-11-01T11:24:39-07:00
New Revision: 309f9a1c52977cbd011b29909f7aa45c124b005f
URL: https://github.com/llvm/llvm-project/commit/309f9a1c52977cbd011b29909f7aa45c124b005f
DIFF: https://github.com/llvm/llvm-project/commit/309f9a1c52977cbd011b29909f7aa45c124b005f.diff
LOG: [debuginfo-tests] Don't look for Python 3 if we already have it
LLDB already requires Python 3 on Windows, so I already configure it
that way. For some reason CMake fails to find the one that Visual Studio
automatically installs at this standard location:
C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/python.exe
CMake prefers the python on path, which happens to be python 2.7.
Reviewers: aprantl, jmorse
Differential Revision: https://reviews.llvm.org/D69684
Added:
Modified:
debuginfo-tests/CMakeLists.txt
Removed:
################################################################################
diff --git a/debuginfo-tests/CMakeLists.txt b/debuginfo-tests/CMakeLists.txt
index 0ac48da5fbc9..68ce63984458 100644
--- a/debuginfo-tests/CMakeLists.txt
+++ b/debuginfo-tests/CMakeLists.txt
@@ -13,20 +13,26 @@ set(DEBUGINFO_TEST_DEPS
not
)
-# Wipe, uh, previous results
-unset(PYTHONINTERP_FOUND CACHE)
-unset(PYTHON_EXECUTABLE CACHE)
-unset(PYTHON_LIBRARY CACHE)
-unset(PYTHON_DLL CACHE)
-unset(PYTHON_INCLUDE_DIR CACHE)
-unset(PYTHON_VERSION_STRING CACHE)
-unset(PYTHON_VERSION_MAJOR CACHE)
-unset(PYTHON_VERSION_MINOR CACHE)
-unset(PYTHON_VERSION_PATCH CACHE)
-unset(PYTHONLIBS_VERSION_STRING CACHE)
+# If we don't already have Python 3, throw away any previous results and try to
+# find it again.
+set(DEBUGINFO_UNSET_PYTHON3 OFF)
+if (PYTHON_VERSION_MAJOR LESS 3)
+ unset(PYTHONINTERP_FOUND CACHE)
+ unset(PYTHON_EXECUTABLE CACHE)
+ unset(PYTHON_LIBRARY CACHE)
+ unset(PYTHON_DLL CACHE)
+ unset(PYTHON_INCLUDE_DIR CACHE)
+ unset(PYTHON_VERSION_STRING CACHE)
+ unset(PYTHON_VERSION_MAJOR CACHE)
+ unset(PYTHON_VERSION_MINOR CACHE)
+ unset(PYTHON_VERSION_PATCH CACHE)
+ unset(PYTHONLIBS_VERSION_STRING CACHE)
+
+ # Try to find python3. If it doesn't exist, dexter tests can't run.
+ find_package(PythonInterp "3")
+ set(DEBUGINFO_UNSET_PYTHON3 ON)
+endif()
-# Try to find python3. If it doesn't exist, dexter tests can't run.
-find_package(PythonInterp "3")
if (NOT DEFINED PYTHON_EXECUTABLE)
message(FATAL_ERROR "Cannot run debuginfo-tests without python")
elseif(PYTHON_VERSION_MAJOR LESS 3)
@@ -43,17 +49,20 @@ else()
${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${DEBUGINFO_TEST_DEPS}
)
- set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests")
+ set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests")
endif()
-# Prevent the rest of llvm observing our secret python3-ness
-unset(PYTHONINTERP_FOUND CACHE)
-unset(PYTHON_EXECUTABLE CACHE)
-unset(PYTHON_LIBRARY CACHE)
-unset(PYTHON_DLL CACHE)
-unset(PYTHON_INCLUDE_DIR CACHE)
-unset(PYTHON_VERSION_STRING CACHE)
-unset(PYTHON_VERSION_MAJOR CACHE)
-unset(PYTHON_VERSION_MINOR CACHE)
-unset(PYTHON_VERSION_PATCH CACHE)
-unset(PYTHONLIBS_VERSION_STRING CACHE)
+# Prevent the rest of llvm observing our secret python3-ness, if that wasn't
+# what was originally found.
+if (DEBUGINFO_UNSET_PYTHON3)
+ unset(PYTHONINTERP_FOUND CACHE)
+ unset(PYTHON_EXECUTABLE CACHE)
+ unset(PYTHON_LIBRARY CACHE)
+ unset(PYTHON_DLL CACHE)
+ unset(PYTHON_INCLUDE_DIR CACHE)
+ unset(PYTHON_VERSION_STRING CACHE)
+ unset(PYTHON_VERSION_MAJOR CACHE)
+ unset(PYTHON_VERSION_MINOR CACHE)
+ unset(PYTHON_VERSION_PATCH CACHE)
+ unset(PYTHONLIBS_VERSION_STRING CACHE)
+endif()
More information about the llvm-commits
mailing list