fn create_local_arch_cargo_config(&self) {
        if env::var("CARGO_MANIFEST_DIR").is_err() {
            env::set_var("CARGO_MANIFEST_DIR", env::current_dir().unwrap().to_str().unwrap());
        }
        let config_path_str = format!("{}/.cargo/config", env::var("CARGO_MANIFEST_DIR").unwrap());
        let cargo_config_path = Path::new(&config_path_str);
        if !cargo_config_path.exists() {
            create_dir_all(cargo_config_path.parent().unwrap()).unwrap();
            // let my_host_triple = platforms::guess_current().expect("Unable to determine platform").target_triple.to_owned();

            let mut cargo_config = String::new();
            writeln!(cargo_config, "[build]").unwrap();
            writeln!(cargo_config, "target = \"{}\"", self.my_host_triple).unwrap();
            fs::write(cargo_config_path, cargo_config).unwrap();
        }
    }
/**
    Users of this library may want to build some non-cross platform targets as well. However, cargo
    search for the .cargo/config file up the folder tree, so if there is a higher level project
    that is a cross compiled project, this can trigger cross compilation. This build command
    just set's the target for this project to your local architecture.
    **/
Users of this library may want to build some non-cross platform targets as well. However, cargo
search for the .cargo/config file up the folder tree, so if there is a higher level project
that is a cross compiled project, this can trigger cross compilation. This build command
just set's the target for this project to your local architecture.
Users of this library may want to build some non - cross platform targets as well . However cargo search for the . cargo / config file up the folder tree so if there is a higher level project that is a cross compiled project this can trigger cross compilation . This build command just set ' s the target for this project to your local architecture .
fn create_local_arch_cargo_config(&self) {
        if env::var("CARGO_MANIFEST_DIR").is_err() {
            env::set_var("CARGO_MANIFEST_DIR", env::current_dir().unwrap().to_str().unwrap());
        }
        let config_path_str = format!("{}/.cargo/config", env::var("CARGO_MANIFEST_DIR").unwrap());
        let cargo_config_path = Path::new(&config_path_str);
        if !cargo_config_path.exists() {
            create_dir_all(cargo_config_path.parent().unwrap()).unwrap();
            // let my_host_triple = platforms::guess_current().expect("Unable to determine platform").target_triple.to_owned();
            let mut cargo_config = String::new();
            writeln!(cargo_config, "[build]").unwrap();
            writeln!(cargo_config, "target = \"{}\"", self.my_host_triple).unwrap();
            fs::write(cargo_config_path, cargo_config).unwrap();
        }
    }
fn create_local_arch_cargo_config ( & self ) { if env :: var ( " " ) . is_err ( ) { env :: set_var ( " " , env :: current_dir ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ) ; } let config_path_str = format ! ( " " env var ( " " ) unwrap ( ) ) ; let cargo_config_path = Path :: new ( & config_path_str ) ; if ! cargo_config_path . exists ( ) { create_dir_all ( cargo_config_path . parent ( ) . unwrap ( ) ) . unwrap ( ) ; // let my_host_triple = platforms::guess_current().expect("Unable to determine platform").target_triple.to_owned(); let mut cargo_config = String :: new ( ) ; writeln ! ( cargo_config " " ) . unwrap ( ) ; writeln ! ( cargo_config " \" \" " self my_host_triple ) . unwrap ( ) ; fs :: write ( cargo_config_path , cargo_config ) . unwrap ( ) ; } }
Users of this library may want to build some non-cross platform targets as well.
Users of this library may want to build some non - cross platform targets as well .
&self