Fix compiletest linker flags for release builds.

This commit is contained in:
Sergio Benitez 2018-01-13 10:18:11 -08:00
parent c63a947b98
commit 58f5988ec4
1 changed files with 8 additions and 0 deletions

View File

@ -8,11 +8,19 @@ fn run_mode(mode: &'static str) {
config.mode = cfg_mode; config.mode = cfg_mode;
config.src_base = PathBuf::from(format!("tests/{}", mode)); config.src_base = PathBuf::from(format!("tests/{}", mode));
#[cfg(debug_assertions)]
let flags = [ let flags = [
"-L crate=../target/debug/", "-L crate=../target/debug/",
"-L dependency=../target/debug/deps/", "-L dependency=../target/debug/deps/",
].join(" "); ].join(" ");
#[cfg(not(debug_assertions))]
let flags = [
"-L crate=../target/release/",
"-L dependency=../target/release/deps/",
].join(" ");
config.target_rustcflags = Some(flags); config.target_rustcflags = Some(flags);
compiletest::run_tests(&config); compiletest::run_tests(&config);
} }