aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/rust/3 staticlib
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/rust/3 staticlib
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
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"}
+ ]
+}