mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 09:31:36 +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:
@@ -112,3 +112,6 @@ keys/
|
|||||||
|
|
||||||
# metadata
|
# metadata
|
||||||
_emscripten_sdk/
|
_emscripten_sdk/
|
||||||
|
|
||||||
|
# virtual Python environment
|
||||||
|
.venv
|
||||||
|
|||||||
@@ -162,6 +162,12 @@ else
|
|||||||
|
|
||||||
endif
|
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
|
# Pick up specific Python path if set
|
||||||
ifdef PYTHON_EXECUTABLE
|
ifdef PYTHON_EXECUTABLE
|
||||||
override CMAKE_ARGS += -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
|
override CMAKE_ARGS += -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
|
||||||
|
|||||||
Reference in New Issue
Block a user