From 847151ff4ffc9f1437a67d320432da388758527c Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 21 Jul 2023 15:23:27 -0400 Subject: [PATCH] rust: Fix import lib naming when cross compiling --- mesonbuild/build.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 6438b836d461..c0490a2296ba 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -2253,8 +2253,12 @@ def determine_filenames(self): if self.uses_rust(): # Shared library is of the form foo.dll prefix = '' - # Import library is called foo.dll.lib - self.import_filename = f'{self.name}.dll.lib' + if self.get_using_msvc(): + # Import library is called foo.dll.lib when using MSVC linker + self.import_filename = f'{self.name}.dll.lib' + else: + # Import library is called libfoo.dll.a when using GCC linker + self.import_filename = f'lib{self.name}.dll.a' # .pdb file is only created when debug symbols are enabled create_debug_file = self.environment.coredata.get_option(OptionKey("debug")) elif self.get_using_msvc():