[cmake] Pass PYTHON_EXECUTABLE to native builds #163574
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ensure that the nested native build uses the same python interpreter as the main build, in case the python that CMake detects first is not the python that the user has specified explicitly.
For example, if the person building LLVM wants to use a different python interpreter to build (eg, testing the build with
python3.14
whenpython3
is a link topython3.8
, or the default python doesn't have development headers available) then they could add-DPYTHON_EXECUTABLE=python3.14
when invoking CMake. This should be forwarded to the native CMake build to ensure that the same python is used.Original fix by Anuj Mittal anuj.mittal@intel.com.