build(make): support Python venv (#26852)

* use venv python executable if active

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* untrack .venv

Signed-off-by: Onur Özkan <work@onurozkan.dev>

---------

Signed-off-by: Onur Özkan <work@onurozkan.dev>
This commit is contained in:
Onur Özkan 2026-03-24 03:44:40 +03:00 committed by GitHub
parent 1639c7f9c6
commit 8d4a5cc76c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

3
.gitignore vendored
View File

@ -112,3 +112,6 @@ keys/
# metadata
_emscripten_sdk/
# virtual Python environment
.venv

View File

@ -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}