From 5d61d21a82071fb7237e6877866f9ea85653cb6c Mon Sep 17 00:00:00 2001 From: Jamie Smith Date: Tue, 14 Oct 2025 07:55:36 -0700 Subject: [PATCH] Fix using the Python launcher on Windows --- tools/cmake/mbed_python_interpreter.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/cmake/mbed_python_interpreter.cmake b/tools/cmake/mbed_python_interpreter.cmake index 6c5e2a5dd33..cf72acd65fd 100644 --- a/tools/cmake/mbed_python_interpreter.cmake +++ b/tools/cmake/mbed_python_interpreter.cmake @@ -10,6 +10,11 @@ option(MBED_CREATE_PYTHON_VENV "If true, Mbed OS will create its own virtual env get_filename_component(MBED_CE_TOOLS_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) +# Tell CMake to prefer whichever python the "python3" or "python" commands point to +# as long as it meets requirements. +set(Python3_FIND_UNVERSIONED_NAMES FIRST) +set(Python3_FIND_REGISTRY LAST) + if(MBED_CREATE_PYTHON_VENV) # Use the venv.