From 8d4a5cc76c98de1e1ca839b1618e8dc3c2c6c948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20=C3=96zkan?= Date: Tue, 24 Mar 2026 03:44:40 +0300 Subject: [PATCH] build(make): support Python venv (#26852) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * use venv python executable if active Signed-off-by: Onur Özkan * untrack .venv Signed-off-by: Onur Özkan --------- Signed-off-by: Onur Özkan --- .gitignore | 3 +++ Makefile | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index fcf982c8df..fc09c23fb8 100644 --- a/.gitignore +++ b/.gitignore @@ -112,3 +112,6 @@ keys/ # metadata _emscripten_sdk/ + +# virtual Python environment +.venv diff --git a/Makefile b/Makefile index 6038d225ea..066a36a0f4 100644 --- a/Makefile +++ b/Makefile @@ -162,6 +162,12 @@ else endif +# Prefer the interpreter from an active Python virtual environment. +# Otherwise leave PYTHON_EXECUTABLE unset and let CMake resolve Python. +ifneq ($(strip $(VIRTUAL_ENV)),) + PYTHON_EXECUTABLE ?= $(VIRTUAL_ENV)/bin/python +endif + # Pick up specific Python path if set ifdef PYTHON_EXECUTABLE override CMAKE_ARGS += -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}