-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust: Add linkdirs of indirect Rust dependencies to the target's link…
…dirs rustc requires all the linkdirs to indirect dependencies to be able to find them, but doesn't require them to be provided as `--extern` in addition. The latter would also easily lead to name conflicts. Fixes #11694
- Loading branch information
Showing
7 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pub fn foo() -> i32 { | ||
123 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
liba = static_library('liba', 'lib.rs', | ||
rust_crate_type : 'rlib', | ||
) | ||
|
||
liba_dep = declare_dependency(link_with : liba) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pub fn bar() -> i32 { | ||
2 * liba::foo() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
libb = static_library('libb', 'lib.rs', | ||
rust_crate_type : 'rlib', | ||
dependencies : [liba_dep], | ||
) | ||
|
||
libb_dep = declare_dependency(link_with : libb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("{}", libb::bar()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
project('transitive dependencies', 'rust', | ||
version : '1.0.0', | ||
meson_version : '>= 1.0.0', | ||
default_options : ['rust_std=2018'], | ||
) | ||
|
||
subdir('liba') | ||
subdir('libb') | ||
|
||
main = executable('main', 'main.rs', | ||
dependencies : [libb_dep], | ||
) |