When linking with a Rust rlib, we should also link with its external system dependencies. This was currently done only for C ABI crates, do it for both rlib and staticlib now.pull/12938/head
parent
a9d42a7c1e
commit
5e0a3073da
4 changed files with 25 additions and 3 deletions
@ -0,0 +1,5 @@ |
||||
extern crate wrapper; |
||||
|
||||
fn main() { |
||||
wrapper::func(); |
||||
} |
@ -0,0 +1,9 @@ |
||||
project('system deps', 'rust') |
||||
|
||||
glib = dependency('glib-2.0', required: false) |
||||
if not glib.found() |
||||
error('MESON_SKIP_TEST: Need glib system dependency') |
||||
endif |
||||
|
||||
rlib = static_library('wrapper', 'wrapper.rs', dependencies: glib) |
||||
exe = executable('main', 'main.rs', link_with: rlib) |
@ -0,0 +1,9 @@ |
||||
extern "C" { |
||||
fn g_hash_table_new() -> *mut std::ffi::c_void; |
||||
} |
||||
|
||||
pub fn func() { |
||||
unsafe { |
||||
g_hash_table_new(); |
||||
} |
||||
} |
Loading…
Reference in new issue