diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-05-11 20:51:18 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-05-11 21:09:00 +0200 |
| commit | 0761802e50e3f11ef4cc170f63659f895bc25d42 (patch) | |
| tree | 7e03b516371b733271b75061fcc457fb826dfe3e | |
| parent | 4a00debfefda0ea72735252e098bd303df6a3ff3 (diff) | |
| download | rust-0761802e50e3f11ef4cc170f63659f895bc25d42.tar.gz rust-0761802e50e3f11ef4cc170f63659f895bc25d42.zip | |
Add `python_command` and `source_path` functions
| -rw-r--r-- | src/tools/run-make-support/src/lib.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs index 9888ca2d1ed..cc81d23a8ff 100644 --- a/src/tools/run-make-support/src/lib.rs +++ b/src/tools/run-make-support/src/lib.rs @@ -54,6 +54,15 @@ pub fn static_lib(name: &str) -> PathBuf { tmp_dir().join(static_lib_name(name)) } +pub fn python_command() -> Command { + let python_path = std::env::var("PYTHON").expect("PYTHON environment variable does not exist"); + Command::new(python_path) +} + +pub fn source_path() -> PathBuf { + std::env::var("S").expect("S variable does not exist").into() +} + /// Construct the static library name based on the platform. pub fn static_lib_name(name: &str) -> String { // See tools.mk (irrelevant lines omitted): |
