Don't require python exe and lib versions to match while crosscompiling

Summary:
While cross compiling, the python executable is used to run a handful
of scripts while the libraries are linked and headers are included.
Theoretically it's possible for the versions to match completely, but
requiring the build to match 2.7.10 to 2.7.15 is unnecessary.

Subscribers: mgorny

Differential Revision: https://reviews.llvm.org/D64822

llvm-svn: 366285
This commit is contained in:
Nathan Lanza 2019-07-16 23:54:17 +00:00
parent 9304e59c01
commit 98a48794ec

View File

@ -198,7 +198,8 @@ if (NOT LLDB_DISABLE_PYTHON)
find_package(PythonLibs REQUIRED)
endif()
if (NOT PYTHON_VERSION_STRING VERSION_EQUAL PYTHONLIBS_VERSION_STRING)
if (NOT PYTHON_VERSION_STRING VERSION_EQUAL PYTHONLIBS_VERSION_STRING AND
NOT CMAKE_CROSSCOMPILING)
message(FATAL_ERROR "Found incompatible Python interpreter (${PYTHON_VERSION_STRING}) and Python libraries (${PYTHONLIBS_VERSION_STRING})")
endif()