diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-03-22 23:40:52 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-03-22 23:45:24 +0200 |
commit | d5986d9e9d3629438965c6d79e7db16f69079d46 (patch) | |
tree | 27ce2d5394693698d40649f2bf07892f47a6d0ac /mesonbuild/build.py | |
parent | 4e5edff60f4874866d16e7ec43c5927b6af03f8c (diff) | |
download | meson-rustwin.tar.gz |
Fix setup so test suite runs with rustc + MSVC. Closes: 5099rustwin
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 20f0cdb28..e2e558ab0 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1193,6 +1193,10 @@ You probably should put it in link_with instead.''') m = 'Could not get a dynamic linker for build target {!r}' raise AssertionError(m.format(self.name)) + def get_using_rustc(self): + if len(self.sources) > 0 and self.sources[0].fname.endswith('.rs'): + return True + def get_using_msvc(self): ''' Check if the dynamic linker is MSVC. Used by Executable, StaticLibrary, @@ -1610,7 +1614,12 @@ class SharedLibrary(BuildTarget): suffix = 'dll' self.vs_import_filename = '{0}{1}.lib'.format(self.prefix if self.prefix is not None else '', self.name) self.gcc_import_filename = '{0}{1}.dll.a'.format(self.prefix if self.prefix is not None else 'lib', self.name) - if self.get_using_msvc(): + if self.get_using_rustc(): + # Shared library is of the form foo.dll + prefix = '' + # Import library is called foo.dll.lib + self.import_filename = '{0}.dll.lib'.format(self.name) + elif self.get_using_msvc(): # Shared library is of the form foo.dll prefix = '' # Import library is called foo.lib |