Attempt to have a working build for Python 3.7 under windows with appveyor.

- Python 3.7 is built using Visual Studio 2017 so we use the corresponding image.
- Python 3.7 replaces Python 2.7 when building the module.
- Adding the library legacy_stdio_definitions to the linker input as starting with VS 2015 some symbols have been inlined but may be expected by older binaries. This compatibility library exposes these symbols so they can be dynamically linked when required (Cf. https://stackoverflow.com/a/32418900).
This commit is contained in:
Nathan Richard 2019-04-25 15:27:44 +02:00
parent f3a567cedf
commit e1779d3518
3 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,7 @@
version: '2.1.{build}' version: '2.1.{build}'
image: Visual Studio 2017
install: install:
- set PATH=%PATH%;C:\msys64\mingw32\bin - set PATH=%PATH%;C:\msys64\mingw32\bin
@ -7,7 +9,7 @@ build_script:
- cd miniupnpc - cd miniupnpc
- appveyor AddCompilationMessage "Building miniupnpc" - appveyor AddCompilationMessage "Building miniupnpc"
- mingw32-make -f Makefile.mingw - mingw32-make -f Makefile.mingw
- mingw32-make -f Makefile.mingw pythonmodule PYTHON=C:\Python27\python - mingw32-make -f Makefile.mingw pythonmodule PYTHON=C:\Python37\python
# - upnpc-static.exe -l # - upnpc-static.exe -l
after_build: after_build:

View File

@ -46,7 +46,7 @@ libminiupnpc.a: $(OBJS)
$(AR) cr $@ $? $(AR) cr $@ $?
pythonmodule: libminiupnpc.a pythonmodule: libminiupnpc.a
$(PYTHON) setupmingw32.py build --compiler=mingw32 $(PYTHON) setupmingw32.py build
$(PYTHON) setupmingw32.py install --skip-build $(PYTHON) setupmingw32.py install --skip-build
miniupnpc.dll: libminiupnpc.a $(OBJSDLL) miniupnpc.dll: libminiupnpc.a $(OBJSDLL)

View File

@ -22,7 +22,7 @@ setup(name="miniupnpc",
description='miniUPnP client', description='miniUPnP client',
ext_modules=[ ext_modules=[
Extension(name="miniupnpc", sources=["miniupnpcmodule.c"], Extension(name="miniupnpc", sources=["miniupnpcmodule.c"],
libraries=["ws2_32", "iphlpapi"], libraries=["ws2_32", "iphlpapi", "legacy_stdio_definitions"],
extra_objects=["libminiupnpc.a"]) extra_objects=["libminiupnpc.a"])
]) ])