Skip to content

Commit b9180e7

Browse files
Fix using the Python launcher on Windows (#503)
1 parent 6352a90 commit b9180e7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/cmake/mbed_python_interpreter.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ option(MBED_CREATE_PYTHON_VENV "If true, Mbed OS will create its own virtual env
1010

1111
get_filename_component(MBED_CE_TOOLS_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
1212

13+
# Tell CMake to prefer whichever python the "python3" or "python" commands point to
14+
# as long as it meets requirements.
15+
set(Python3_FIND_UNVERSIONED_NAMES FIRST)
16+
set(Python3_FIND_REGISTRY LAST)
17+
1318
if(MBED_CREATE_PYTHON_VENV)
1419
# Use the venv.
1520

0 commit comments

Comments
 (0)