Skip to content

Commit

Permalink
Merge pull request #10 from rgommers/add-mingw-fix
Browse files Browse the repository at this point in the history
Incorporate MinGW detection fix
  • Loading branch information
rgommers authored Jan 16, 2024
2 parents e6e1bf9 + 6cbee1d commit 4e370ca
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions mesonbuild/dependencies/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,15 @@ def find_libpy(self, environment: 'Environment') -> None:
self.is_found = True

def get_windows_python_arch(self) -> T.Optional[str]:
if self.platform == 'mingw':
pycc = self.variables.get('CC')
if pycc.startswith('x86_64'):
if self.platform.startswith('mingw'):
if 'x86_64' in self.platform:
return 'x86_64'
elif pycc.startswith(('i686', 'i386')):
elif 'i686' in self.platform:
return 'x86'
elif 'aarch64' in self.platform:
return 'aarch64'
else:
mlog.log(f'MinGW Python built with unknown CC {pycc!r}, please file a bug')
mlog.log(f'MinGW Python built with unknown platform {self.platform!r}, please file a bug')
return None
elif self.platform == 'win32':
return 'x86'
Expand Down Expand Up @@ -311,7 +312,7 @@ def get_windows_link_args(self) -> T.Optional[T.List[str]]:
'''))
# base_prefix to allow for virtualenvs.
lib = Path(self.variables.get('base_prefix')) / libpath
elif self.platform == 'mingw':
elif self.platform.startswith('mingw'):
if self.static:
libname = self.variables.get('LIBRARY')
else:
Expand Down

0 comments on commit 4e370ca

Please sign in to comment.