|
10 | 10 |
|
11 | 11 | // Context data structure used by rustpkg |
12 | 12 |
|
13 | | -use std::os; |
14 | 13 | use extra::workcache; |
15 | 14 | use rustc::driver::session::{OptLevel, No}; |
16 | 15 |
|
| 16 | +use std::hashmap::HashSet; |
| 17 | +use std::os; |
| 18 | + |
17 | 19 | #[deriving(Clone)] |
18 | 20 | pub struct Context { |
19 | 21 | // Config strings that the user passed in with --cfg |
@@ -60,7 +62,7 @@ impl BuildContext { |
60 | 62 | self.context.add_library_path(p); |
61 | 63 | } |
62 | 64 |
|
63 | | - pub fn additional_library_paths(&self) -> ~[Path] { |
| 65 | + pub fn additional_library_paths(&self) -> HashSet<Path> { |
64 | 66 | self.context.rustc_flags.additional_library_paths.clone() |
65 | 67 | } |
66 | 68 | } |
@@ -96,7 +98,7 @@ pub struct RustcFlags { |
96 | 98 | target_cpu: Option<~str>, |
97 | 99 | // Additional library directories, which get passed with the -L flag |
98 | 100 | // This can't be set with a rustpkg flag, only from package scripts |
99 | | - additional_library_paths: ~[Path], |
| 101 | + additional_library_paths: HashSet<Path>, |
100 | 102 | // Any -Z features |
101 | 103 | experimental_features: Option<~[~str]> |
102 | 104 | } |
@@ -163,7 +165,7 @@ impl Context { |
163 | 165 | } |
164 | 166 |
|
165 | 167 | pub fn add_library_path(&mut self, p: Path) { |
166 | | - self.rustc_flags.additional_library_paths.push(p); |
| 168 | + self.rustc_flags.additional_library_paths.insert(p); |
167 | 169 | } |
168 | 170 | } |
169 | 171 |
|
@@ -227,7 +229,7 @@ impl RustcFlags { |
227 | 229 | save_temps: false, |
228 | 230 | target: None, |
229 | 231 | target_cpu: None, |
230 | | - additional_library_paths: ~[], |
| 232 | + additional_library_paths: HashSet::new(), |
231 | 233 | experimental_features: None |
232 | 234 | } |
233 | 235 | } |
|
0 commit comments