aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/rust/3 staticlib
diff options
context:
space:
mode:
Diffstat (limited to 'meson/test cases/rust/3 staticlib')
-rw-r--r--meson/test cases/rust/3 staticlib/meson.build5
-rw-r--r--meson/test cases/rust/3 staticlib/prog.rs3
-rw-r--r--meson/test cases/rust/3 staticlib/stuff.rs3
-rw-r--r--meson/test cases/rust/3 staticlib/test.json7
4 files changed, 18 insertions, 0 deletions
diff --git a/meson/test cases/rust/3 staticlib/meson.build b/meson/test cases/rust/3 staticlib/meson.build
new file mode 100644
index 000000000..676956463
--- /dev/null
+++ b/meson/test cases/rust/3 staticlib/meson.build
@@ -0,0 +1,5 @@
+project('rust static library', 'rust')
+
+l = static_library('stuff', 'stuff.rs', install : true)
+e = executable('prog', 'prog.rs', link_with : l, install : true)
+test('linktest', e)
diff --git a/meson/test cases/rust/3 staticlib/prog.rs b/meson/test cases/rust/3 staticlib/prog.rs
new file mode 100644
index 000000000..fbf318159
--- /dev/null
+++ b/meson/test cases/rust/3 staticlib/prog.rs
@@ -0,0 +1,3 @@
+extern crate stuff;
+
+fn main() { println!("printing: {}", stuff::explore()); }
diff --git a/meson/test cases/rust/3 staticlib/stuff.rs b/meson/test cases/rust/3 staticlib/stuff.rs
new file mode 100644
index 000000000..8cabc6257
--- /dev/null
+++ b/meson/test cases/rust/3 staticlib/stuff.rs
@@ -0,0 +1,3 @@
+#![crate_name = "stuff"]
+
+pub fn explore() -> &'static str { "librarystring" }
diff --git a/meson/test cases/rust/3 staticlib/test.json b/meson/test cases/rust/3 staticlib/test.json
new file mode 100644
index 000000000..ca292254e
--- /dev/null
+++ b/meson/test cases/rust/3 staticlib/test.json
@@ -0,0 +1,7 @@
+{
+ "installed": [
+ {"type": "exe", "file": "usr/bin/prog"},
+ {"type": "pdb", "file": "usr/bin/prog"},
+ {"type": "file", "file": "usr/lib/libstuff.rlib"}
+ ]
+}