1 use rustc_session::Session;
2 use rustc_span::symbol::Symbol;
5 use std::path::{Path, PathBuf};
7 pub fn find_library(name: Symbol, search_paths: &[PathBuf], sess: &Session) -> PathBuf {
8 // On Windows, static libraries sometimes show up as libfoo.a and other
9 // times show up as foo.lib
11 format!("{}{}{}", sess.target.staticlib_prefix, name, sess.target.staticlib_suffix);
12 let unixlibname = format!("lib{}.a", name);
14 for path in search_paths {
15 debug!("looking for {} inside {:?}", name, path);
16 let test = path.join(&oslibname);
20 if oslibname != unixlibname {
21 let test = path.join(&unixlibname);
28 "could not find native static library `{}`, \
29 perhaps an -L flag is missing?",
34 pub trait ArchiveBuilder<'a> {
35 fn new(sess: &'a Session, output: &Path, input: Option<&Path>) -> Self;
37 fn add_file(&mut self, path: &Path);
38 fn remove_file(&mut self, name: &str);
39 fn src_files(&mut self) -> Vec<String>;
48 fn add_native_library(&mut self, name: Symbol);
49 fn update_symbols(&mut self);