aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/backend/ninjabackend.py1
-rw-r--r--test cases/rust/6 named staticlib/installed_files.txt2
-rw-r--r--test cases/rust/6 named staticlib/meson.build5
-rw-r--r--test cases/rust/6 named staticlib/prog.rs3
-rw-r--r--test cases/rust/6 named staticlib/stuff.rs1
5 files changed, 12 insertions, 0 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 08ae456..3b2a941 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -1176,6 +1176,7 @@ int dummy;
else:
raise InvalidArguments('Unknown target type for rustc.')
args.append(cratetype)
+ args += ['--crate-name', target.name]
args += rustc.get_buildtype_args(self.get_option_for_target('buildtype', target))
depfile = os.path.join(target.subdir, target.name + '.d')
args += ['--emit', 'dep-info={}'.format(depfile), '--emit', 'link']
diff --git a/test cases/rust/6 named staticlib/installed_files.txt b/test cases/rust/6 named staticlib/installed_files.txt
new file mode 100644
index 0000000..bd023ef
--- /dev/null
+++ b/test cases/rust/6 named staticlib/installed_files.txt
@@ -0,0 +1,2 @@
+usr/bin/prog?exe
+usr/lib/libnamed_stuff.rlib
diff --git a/test cases/rust/6 named staticlib/meson.build b/test cases/rust/6 named staticlib/meson.build
new file mode 100644
index 0000000..f91b7a1
--- /dev/null
+++ b/test cases/rust/6 named staticlib/meson.build
@@ -0,0 +1,5 @@
+project('rust static library', 'rust')
+
+l = static_library('named_stuff', 'stuff.rs', install : true)
+e = executable('prog', 'prog.rs', link_with : l, install : true)
+test('linktest', e)
diff --git a/test cases/rust/6 named staticlib/prog.rs b/test cases/rust/6 named staticlib/prog.rs
new file mode 100644
index 0000000..856c4b7
--- /dev/null
+++ b/test cases/rust/6 named staticlib/prog.rs
@@ -0,0 +1,3 @@
+extern crate named_stuff;
+
+fn main() { println!("printing: {}", named_stuff::explore()); }
diff --git a/test cases/rust/6 named staticlib/stuff.rs b/test cases/rust/6 named staticlib/stuff.rs
new file mode 100644
index 0000000..9b36e57
--- /dev/null
+++ b/test cases/rust/6 named staticlib/stuff.rs
@@ -0,0 +1 @@
+pub fn explore() -> &'static str { "librarystring" }