mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
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:
parent
1639c7f9c6
commit
8d4a5cc76c
3
.gitignore
vendored
3
.gitignore
vendored
@ -112,3 +112,6 @@ keys/
|
||||
|
||||
# metadata
|
||||
_emscripten_sdk/
|
||||
|
||||
# virtual Python environment
|
||||
.venv
|
||||
|
||||
6
Makefile
6
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}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user