Skip to content

Commit

Permalink
fix: use CARGO_TARGET_DIR when symlinking on android
Browse files Browse the repository at this point in the history
continuation of #73
  • Loading branch information
amrbashir committed Apr 3, 2023
1 parent 2d37899 commit 8c62319
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/android/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::{
};
use once_cell_regex::exports::once_cell::sync::OnceCell;
use serde::Serialize;
use std::{collections::BTreeMap, fmt, fs, io, path::PathBuf, str};
use std::{collections::BTreeMap, fmt, io, path::PathBuf, str};
use thiserror::Error;

#[derive(Clone, Copy, Debug)]
Expand Down
4 changes: 4 additions & 0 deletions src/config/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ impl App {
pub fn target_dir(&self, triple: &str, profile: Profile) -> PathBuf {
if let Some(resolver) = &self.target_dir_resolver {
resolver(triple, profile)
} else if let Ok(target) = std::env::var("CARGO_TARGET_DIR") {
self.prefix_path(format!("{}/{}/{}", target, triple, profile.as_str()))
} else if let Ok(target) = std::env::var("CARGO_BUILD_TARGET_DIR") {
self.prefix_path(format!("{}/{}/{}", target, triple, profile.as_str()))
} else {
self.prefix_path(format!("target/{}/{}", triple, profile.as_str()))
}
Expand Down

0 comments on commit 8c62319

Please sign in to comment.