From 7bdfaf3d42b5f718cbdfa2d0ce9beb6adfa099f4 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Wed, 15 Oct 2025 15:21:16 +0100 Subject: [PATCH] [cmake] Pass PYTHON_EXECUTABLE to native builds 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. Original fix by Anuj Mittal . --- llvm/cmake/modules/CrossCompile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake index bfbd9cfd4063f..2a69c5133c56f 100644 --- a/llvm/cmake/modules/CrossCompile.cmake +++ b/llvm/cmake/modules/CrossCompile.cmake @@ -101,6 +101,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_TABLEGEN_FLAGS="${LLVM_TABLEGEN_FLAGS}" + -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" ${build_type_flags} ${linker_flag} ${external_clang_dir} ${libc_flags} ${ARGN} WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD}