python dependency: avoid redefinition warnings for MS_WIN64

pyconfig.h defines it in limited cases, but as empty, rather than as "1"
which is what command-line defines generally do. Explicitly define it as
a compatible definition so the compiler does not log a warning that the
value has changed.

Fixes #11592
pull/11597/head
Eli Schwartz 2 years ago
parent 9d98b4cb84
commit 81c3c3808e
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      mesonbuild/dependencies/python.py

@ -209,7 +209,7 @@ class PythonSystemDependency(SystemDependency, _PythonDependencyBase):
# https://sourceforge.net/p/mingw-w64/mailman/message/30504611/
# https://github.com/python/cpython/pull/100137
if mesonlib.is_windows() and self.get_windows_python_arch() == '64' and mesonlib.version_compare(self.version, '<3.12'):
self.compile_args += ['-DMS_WIN64']
self.compile_args += ['-DMS_WIN64=']
if not self.clib_compiler.has_header('Python.h', '', environment, extra_args=self.compile_args):
self.is_found = False

Loading…
Cancel
Save