Skip to content

Commit 0ae0ac0

Browse files
authored
[cmake] Pass PYTHON_EXECUTABLE to native builds (#163574)
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` when `python3` is a link to `python3.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 <[email protected]>.
1 parent 5be12e1 commit 0ae0ac0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/cmake/modules/CrossCompile.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
101101
-DLLVM_INCLUDE_BENCHMARKS=OFF
102102
-DLLVM_INCLUDE_TESTS=OFF
103103
-DLLVM_TABLEGEN_FLAGS="${LLVM_TABLEGEN_FLAGS}"
104+
-DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}"
104105
${build_type_flags} ${linker_flag} ${external_clang_dir} ${libc_flags}
105106
${ARGN}
106107
WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD}

0 commit comments

Comments
 (0)