[lldb/CMake] Add LLDB_PYTHON_VERSION to use Python 2 with CMake > 3.12
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 9 Jun 2020 21:09:42 +0000 (14:09 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 9 Jun 2020 21:11:11 +0000 (14:11 -0700)
commit2c0afacada0d1488bc88b1211203ea4fdb0a23e8
treebc64ab319282862c957ec78b5165a3156797a611
parent765ac39db21503739e447ec9be0f06ef243170dd
[lldb/CMake] Add LLDB_PYTHON_VERSION to use Python 2 with CMake > 3.12

In addition to having the default fallback from Python 3 to Python 2, it
should also be possible to build against Python 2 explicitly. This patch
makes that possible by setting LLDB_PYTHON_VERSION. The variable only
has effect with CMake 3.12 or later.

Differential revision: https://reviews.llvm.org/D81501
lldb/cmake/modules/FindPythonInterpAndLibs.cmake