mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +03:00
Windows MSVC: 64bit compiler sees 2 export symbols
The MSVC compiler sees a request for the main symbol (init__pyscopg) to be exported twice during the build process and issues a warning in 64bit mode. One symbol is from distutils exporting the library with the build_ext.get_export_symbols() function, the other is from the #define PyMODINIT_FUNC (define in pyport.h) that begins the main _psycopg module. This patch overrides the get_export_symbols function and returns an empty array of symbols to export if the compiler is MSVC.
This commit is contained in:
parent
7c2fa77c4b
commit
2997c0eb6c
7
setup.py
7
setup.py
|
@ -155,6 +155,13 @@ class psycopg_build_ext(build_ext):
|
|||
def get_pg_config(self, kind):
|
||||
return get_pg_config(kind, self.pg_config)
|
||||
|
||||
def get_export_symbols(self, ext):
|
||||
# Fix MSVC seeing two of the same export symbols.
|
||||
if self.get_compiler().lower().startswith('msvc'):
|
||||
return []
|
||||
else:
|
||||
return build_ext.get_export_symbols(self, ext)
|
||||
|
||||
def build_extension(self, ext):
|
||||
build_ext.build_extension(self, ext)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user