[PATCH] D78762: build: use `find_package(Python3)` if available

Jonas Devlieghere via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 24 11:21:07 PDT 2020


JDevlieghere requested changes to this revision.
JDevlieghere added a comment.
This revision now requires changes to proceed.

I would strongly prefer to do this differently. While we hope to drop Python 2 support in LLDB as soon as possible, we are not there yet. This patch as it stands will make it really hard for us to keep doing so (even internally) if upstream decides to drop support. I have looked into this change myself a while ago with these limitations in mind, and believe we can achieve the same in a way that would make this easier.

My suggestion is to have 4 new CMake variable that abstract over this: `LLVM_PYTHON_EXECUTABLE`, `LLVM_PYTHON_LIBRARIES`, `LLVM_PYTHON_INCLUDE_DIRS` and finally `LLVM_PYTHON_HINT`.  We can then populate the first three depending on what machinery we want to use, i.e. the old CMake way of finding Python (until we bump the requirement across llvm), as well as the new `FindPython3` and `FindPython2`. Similarly for the `HINT` variable, having our own abstraction means we don't clobber any of the variables used internally by CMake.

What do you think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78762





More information about the cfe-commits mailing list