diff options
author | Nacho GarcÃa <nacho.garglez@gmail.com> | 2019-02-21 18:53:06 +0100 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2019-03-18 09:51:31 +0000 |
commit | 222a973918fe01ae0c4051a821797dde96f018af (patch) | |
tree | e9627525ec878f0e8f3bda588b23e32f1bb4cd44 /mesonbuild/modules/python.py | |
parent | eb76ba7031f053a3c1e69ce79f52bf84a222fa48 (diff) | |
download | meson-222a973918fe01ae0c4051a821797dde96f018af.zip meson-222a973918fe01ae0c4051a821797dde96f018af.tar.gz meson-222a973918fe01ae0c4051a821797dde96f018af.tar.bz2 |
dependencies: fix Python linking for windows+mingw
For dynamic linking, some mingw releases don't link
correctly with pythonXX.lib in all cases.
This patch forces mingw to link against
pyhthonXX.dll instead of the .lib file, which has
a better compatiblity.
Note that msys 1.0 old platform is detected
as windows instead of 'mingw'
Diffstat (limited to 'mesonbuild/modules/python.py')
-rw-r--r-- | mesonbuild/modules/python.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 049c457..34fe5a5 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -184,10 +184,14 @@ class PythonDependency(ExternalDependency): if self.platform.startswith('win'): vernum = self.variables.get('py_version_nodot') if self.static: - libname = 'libpython{}.a'.format(vernum) + libpath = Path('libs') / 'libpython{}.a'.format(vernum) else: - libname = 'python{}.lib'.format(vernum) - lib = Path(self.variables.get('base')) / 'libs' / libname + comp = self.get_compiler() + if comp.id == "gcc": + libpath = 'python{}.dll'.format(vernum) + else: + libpath = Path('libs') / 'python{}.lib'.format(vernum) + lib = Path(self.variables.get('base')) / libpath elif self.platform == 'mingw': if self.static: libname = self.variables.get('LIBRARY') |