1 use cargo_metadata::MetadataCommand;
2 use lazy_static::lazy_static;
4 use std::path::PathBuf;
7 pub static ref CARGO_TARGET_DIR: PathBuf = {
8 match env::var_os("CARGO_TARGET_DIR") {
10 None => MetadataCommand::new().exec().unwrap().target_directory,
13 pub static ref TARGET_LIB: PathBuf = {
14 if let Some(path) = option_env!("TARGET_LIBS") {
17 let mut dir = CARGO_TARGET_DIR.clone();
18 if let Some(target) = env::var_os("CARGO_BUILD_TARGET") {
21 dir.push(env!("PROFILE"));
28 pub fn is_rustc_test_suite() -> bool {
29 option_env!("RUSTC_TEST_SUITE").is_some()