mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Support cross-compile install
This commit is contained in:
parent
3b94f44ec4
commit
0774e97da3
@ -32,6 +32,7 @@ pub fn cli() -> App {
|
||||
"Install only the specified example",
|
||||
"Install all examples",
|
||||
)
|
||||
.arg_target_triple("Build for the target triple")
|
||||
.arg(opt("root", "Directory to install packages into").value_name("DIR"))
|
||||
.after_help(
|
||||
"\
|
||||
|
@ -4,6 +4,7 @@ use std::io::prelude::*;
|
||||
|
||||
use cargo::util::ProcessBuilder;
|
||||
use cargotest::install::{cargo_home, has_installed_exe};
|
||||
use cargotest::support::cross_compile;
|
||||
use cargotest::support::git;
|
||||
use cargotest::support::paths;
|
||||
use cargotest::support::registry::Package;
|
||||
@ -1334,6 +1335,40 @@ fn dev_dependencies_lock_file_untouched() {
|
||||
assert!(lock == lock2, "different lockfiles");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn install_target_native() {
|
||||
pkg("foo", "0.1.0");
|
||||
|
||||
assert_that(
|
||||
cargo_process("install")
|
||||
.arg("foo")
|
||||
.arg("--target")
|
||||
.arg(cargotest::rustc_host()),
|
||||
execs()
|
||||
.with_status(0),
|
||||
);
|
||||
assert_that(cargo_home(), has_installed_exe("foo"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn install_target_foreign() {
|
||||
if cross_compile::disabled() {
|
||||
return;
|
||||
}
|
||||
|
||||
pkg("foo", "0.1.0");
|
||||
|
||||
assert_that(
|
||||
cargo_process("install")
|
||||
.arg("foo")
|
||||
.arg("--target")
|
||||
.arg(cross_compile::alternate()),
|
||||
execs()
|
||||
.with_status(0),
|
||||
);
|
||||
assert_that(cargo_home(), has_installed_exe("foo"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn vers_precise() {
|
||||
pkg("foo", "0.1.1");
|
||||
|
Loading…
x
Reference in New Issue
Block a user