Browse Source

Merge pull request #214 from AndyGauge/lib-name-fix

Preventing bug if liberace makes a library using new syntax
cmd
Alex Crichton 8 years ago
committed by GitHub
parent
commit
93b3531d16
  1. 8
      src/lib.rs

8
src/lib.rs

@ -506,9 +506,11 @@ impl Config {
/// compiler commands fails. It can also panic if it fails reading file names /// compiler commands fails. It can also panic if it fails reading file names
/// or creating directories. /// or creating directories.
pub fn compile(&self, output: &str) { pub fn compile(&self, output: &str) {
let name_start = if output.starts_with("lib") { 3 } else { 0 }; let lib_name = if output.starts_with("lib") && output.ends_with(".a") {
let name_end = if output.ends_with(".a") { output.len() - 2 } else { output.len() }; &output[3..output.len() - 2]
let lib_name = &output[name_start..name_end]; } else {
&output
};
let dst = self.get_out_dir(); let dst = self.get_out_dir();
let mut objects = Vec::new(); let mut objects = Vec::new();

Loading…
Cancel
Save