This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Find python before searching for python modules
ClosedPublic

Authored by dim on Aug 4 2022, 12:11 PM.

Details

Summary

In the top-level llvm CMakeLists.txt, we need to call
find_package(Python3) *before* including config-ix.cmake, otherwise
the latter will not be able to successfully search for python modules
using find_python_module(). Also set LLVM_MINIMUM_PYTHON_VERSION
before calling find_package(Python3), moving it to CMakeLists.txt
from HandleLLVMOptions.cmake.

Diff Detail

Event Timeline

dim created this revision.Aug 4 2022, 12:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2022, 12:11 PM
Herald added a subscriber: mgorny. · View Herald Transcript
dim requested review of this revision.Aug 4 2022, 12:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2022, 12:11 PM
compnerd accepted this revision.Aug 4 2022, 1:23 PM
compnerd added inline comments.
llvm/CMakeLists.txt
766

I'd move it to L775 since this is speaking to the find_package rather than the setting of the LLVM_MINIMUM_PYTHON_VERSION.

This revision is now accepted and ready to land.Aug 4 2022, 1:23 PM
dim updated this revision to Diff 450257.Aug 5 2022, 1:45 AM

Address review comments.

dim marked an inline comment as done.Aug 5 2022, 1:46 AM
This revision was landed with ongoing or failed builds.Aug 5 2022, 1:48 AM
This revision was automatically updated to reflect the committed changes.