File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -248,12 +248,19 @@ impl Library {
248
248
249
249
/// Print `cargo:rustc-link-*` metadata to stdout
250
250
pub fn print_cargo_metadata ( & self ) -> Result < ( ) > {
251
- println ! ( "cargo:rustc-link-search={}" , self . library_dir. display ( ) ) ;
251
+ let mut dirs = vec ! [ & self . library_dir] ;
252
252
if let Some ( iomp5_dir) = & self . iomp5_dir {
253
253
if iomp5_dir != & self . library_dir {
254
- println ! ( "cargo:rustc-link-search={}" , iomp5_dir . display ( ) ) ;
254
+ dirs . push ( iomp5_dir ) ;
255
255
}
256
256
}
257
+ for dir in dirs {
258
+ println ! ( "cargo:rustc-link-search={}" , dir. display( ) ) ;
259
+ if self . config . link == LinkType :: Dynamic {
260
+ println ! ( "cargo:rustc-link-arg=-Wl,-rpath={}" , dir. display( ) ) ;
261
+ }
262
+ }
263
+
257
264
for lib in self . config . libs ( ) {
258
265
match self . config . link {
259
266
LinkType :: Static => {
You can’t perform that action at this time.
0 commit comments