diff options
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/rust/24 system deps/main.rs | 5 | ||||
-rw-r--r-- | test cases/rust/24 system deps/meson.build | 9 | ||||
-rw-r--r-- | test cases/rust/24 system deps/wrapper.rs | 9 |
3 files changed, 23 insertions, 0 deletions
diff --git a/test cases/rust/24 system deps/main.rs b/test cases/rust/24 system deps/main.rs new file mode 100644 index 0000000..cfa599b --- /dev/null +++ b/test cases/rust/24 system deps/main.rs @@ -0,0 +1,5 @@ +extern crate wrapper; + +fn main() { + wrapper::func(); +} diff --git a/test cases/rust/24 system deps/meson.build b/test cases/rust/24 system deps/meson.build new file mode 100644 index 0000000..d9160f1 --- /dev/null +++ b/test cases/rust/24 system deps/meson.build @@ -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) diff --git a/test cases/rust/24 system deps/wrapper.rs b/test cases/rust/24 system deps/wrapper.rs new file mode 100644 index 0000000..630cd77 --- /dev/null +++ b/test cases/rust/24 system deps/wrapper.rs @@ -0,0 +1,9 @@ +extern "C" { + fn g_hash_table_new() -> *mut std::ffi::c_void; +} + +pub fn func() { + unsafe { + g_hash_table_new(); + } +} |