diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-02-21 13:25:51 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-02-21 13:25:51 +0200 |
commit | 560d9d73755e02265377706840efc63e50c693b1 (patch) | |
tree | 9072b798735135c76d8fc797ee7d7357df3146b1 /mesonbuild/environment.py | |
parent | 0469128f46f9d7239426868b168323d0d5adb9b8 (diff) | |
parent | 21d471673addc6f61329ffe8ac6d4d919c6c70c6 (diff) | |
download | meson-560d9d73755e02265377706840efc63e50c693b1.zip meson-560d9d73755e02265377706840efc63e50c693b1.tar.gz meson-560d9d73755e02265377706840efc63e50c693b1.tar.bz2 |
Merge pull request #398 from nirbheek/target-link-implib
Re-introduce patch to fix linking with MSVC by linking with import library.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 8df856c..c43c5e1 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -98,7 +98,12 @@ class Environment(): if (not cross and mesonlib.is_windows()) \ or (cross and self.cross_info.has_host() and self.cross_info.config['host_machine']['system'] == 'windows'): self.exe_suffix = 'exe' - self.import_lib_suffix = 'lib' + if self.detect_c_compiler(cross).get_id() == 'msvc': + self.import_lib_suffix = 'lib' + else: + # MinGW-GCC doesn't generate and can't link with a .lib + # It uses the DLL file as the import library + self.import_lib_suffix = 'dll' self.shared_lib_suffix = 'dll' self.shared_lib_prefix = '' self.static_lib_suffix = 'lib' @@ -546,7 +551,7 @@ class Environment(): def get_exe_suffix(self): return self.exe_suffix - # On Windows the library has suffix dll + # On Windows (MSVC) the library has suffix dll # but you link against a file that has suffix lib. def get_import_lib_suffix(self): return self.import_lib_suffix |