diff options
Diffstat (limited to 'crates/project_model/src')
-rw-r--r-- | crates/project_model/src/build_data.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/project_model/src/build_data.rs b/crates/project_model/src/build_data.rs index cf32995e0..3ff347e2c 100644 --- a/crates/project_model/src/build_data.rs +++ b/crates/project_model/src/build_data.rs | |||
@@ -175,7 +175,7 @@ fn is_dylib(path: &Path) -> bool { | |||
175 | /// Should be synced with <https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates> | 175 | /// Should be synced with <https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates> |
176 | fn inject_cargo_env(package: &cargo_metadata::Package, env: &mut Vec<(String, String)>) { | 176 | fn inject_cargo_env(package: &cargo_metadata::Package, env: &mut Vec<(String, String)>) { |
177 | // FIXME: Missing variables: | 177 | // FIXME: Missing variables: |
178 | // CARGO, CARGO_PKG_HOMEPAGE, CARGO_CRATE_NAME, CARGO_BIN_NAME, CARGO_BIN_EXE_<name> | 178 | // CARGO_PKG_HOMEPAGE, CARGO_CRATE_NAME, CARGO_BIN_NAME, CARGO_BIN_EXE_<name> |
179 | 179 | ||
180 | let mut manifest_dir = package.manifest_path.clone(); | 180 | let mut manifest_dir = package.manifest_path.clone(); |
181 | manifest_dir.pop(); | 181 | manifest_dir.pop(); |
@@ -183,6 +183,9 @@ fn inject_cargo_env(package: &cargo_metadata::Package, env: &mut Vec<(String, St | |||
183 | env.push(("CARGO_MANIFEST_DIR".into(), cargo_manifest_dir.into())); | 183 | env.push(("CARGO_MANIFEST_DIR".into(), cargo_manifest_dir.into())); |
184 | } | 184 | } |
185 | 185 | ||
186 | // Not always right, but works for common cases. | ||
187 | env.push(("CARGO".into(), "cargo".into())); | ||
188 | |||
186 | env.push(("CARGO_PKG_VERSION".into(), package.version.to_string())); | 189 | env.push(("CARGO_PKG_VERSION".into(), package.version.to_string())); |
187 | env.push(("CARGO_PKG_VERSION_MAJOR".into(), package.version.major.to_string())); | 190 | env.push(("CARGO_PKG_VERSION_MAJOR".into(), package.version.major.to_string())); |
188 | env.push(("CARGO_PKG_VERSION_MINOR".into(), package.version.minor.to_string())); | 191 | env.push(("CARGO_PKG_VERSION_MINOR".into(), package.version.minor.to_string())); |