diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2023-04-13 23:04:51 +0300 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2023-04-21 15:35:06 -0400 |
commit | 01420bf8fc1ee6c1466e2fa4c9805267192dce26 (patch) | |
tree | c419d8b14d4a4144a4a3ce093f853e0c7d385875 /test cases | |
parent | 474e3ea8afd170ae86cc5c3a547caee65f97ecb8 (diff) | |
download | meson-01420bf8fc1ee6c1466e2fa4c9805267192dce26.zip meson-01420bf8fc1ee6c1466e2fa4c9805267192dce26.tar.gz meson-01420bf8fc1ee6c1466e2fa4c9805267192dce26.tar.bz2 |
rust: Add new `rust_dependency_map` target configuration
This allows changing the crate name with which a library ends up being
available inside the Rust code, similar to cargo's dependency renaming
feature or `extern crate foo as bar` inside Rust code.
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/rust/17 staticlib link staticlib/branch.rs | 2 | ||||
-rw-r--r-- | test cases/rust/17 staticlib link staticlib/meson.build | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test cases/rust/17 staticlib link staticlib/branch.rs b/test cases/rust/17 staticlib link staticlib/branch.rs index 29e1cd0..ea97647 100644 --- a/test cases/rust/17 staticlib link staticlib/branch.rs +++ b/test cases/rust/17 staticlib link staticlib/branch.rs @@ -1,4 +1,4 @@ #[no_mangle] pub extern "C" fn what_have_we_here() -> i32 { - leaf::HOW_MANY * leaf::HOW_MANY + myleaf::HOW_MANY * myleaf::HOW_MANY } diff --git a/test cases/rust/17 staticlib link staticlib/meson.build b/test cases/rust/17 staticlib link staticlib/meson.build index 68d08f3..4a01c05 100644 --- a/test cases/rust/17 staticlib link staticlib/meson.build +++ b/test cases/rust/17 staticlib link staticlib/meson.build @@ -3,6 +3,6 @@ project('staticlib link staticlib', 'c', 'rust') leaf = static_library('leaf', 'leaf.rs', rust_crate_type : 'rlib') # Even though leaf is linked using link_with, this gets implicitly promoted to link_whole because # it is an internal Rust project. -branch = static_library('branch', 'branch.rs', link_with: leaf, rust_crate_type : 'staticlib', install : true) +branch = static_library('branch', 'branch.rs', link_with: leaf, rust_crate_type : 'staticlib', rust_dependency_map : { 'leaf' : 'myleaf' }, install : true) e = executable('prog', 'prog.c', link_with : branch, install : true) test('linktest', e) |