Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ def generate_rust_target(self, target, outfile):
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']
Expand Down
2 changes: 2 additions & 0 deletions test cases/rust/6 named staticlib/installed_files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/bin/prog?exe
usr/lib/libnamed_stuff.rlib
5 changes: 5 additions & 0 deletions test cases/rust/6 named staticlib/meson.build
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 3 additions & 0 deletions test cases/rust/6 named staticlib/prog.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extern crate named_stuff;

fn main() { println!("printing: {}", named_stuff::explore()); }
1 change: 1 addition & 0 deletions test cases/rust/6 named staticlib/stuff.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub fn explore() -> &'static str { "librarystring" }