diff --git a/appveyor.yml b/appveyor.yml index ed4ff8078..c401fb864 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,6 +17,7 @@ environment: - PYTHON: "C:\\Python33-x64" PYTHON_VERSION: "3.3.x" PYTHON_ARCH: "64" + DISTUTILS_USE_SDK: "1" - PYTHON: "C:\\Python34" PYTHON_VERSION: "3.4.x" @@ -25,6 +26,7 @@ environment: - PYTHON: "C:\\Python34-x64" PYTHON_VERSION: "3.4.x" PYTHON_ARCH: "64" + DISTUTILS_USE_SDK: "1" - PYTHON: "C:\\Python35" PYTHON_VERSION: "3.5.x" @@ -68,26 +70,26 @@ install: - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" # Check that we have the expected version and architecture for Python - - "python --version" - - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" + - "build.cmd %PYTHON%\\python.exe --version" + - "build.cmd %PYTHON%\\python.exe -c \"import struct; print(struct.calcsize('P') * 8)\"" # Install setuptools/wheel so that we can e.g. use bdist_wheel - "pip install setuptools wheel" - - "python setup.py develop" + - "build.cmd %PYTHON%\\python.exe setup.py develop" build_script: # Build the compiled extension - - "python setup.py build" + - "build.cmd %PYTHON%\\python.exe setup.py build" test_script: - - "python setup.py test" + - "build.cmd %PYTHON%\\python.exe setup.py test" after_test: - - "python setup.py bdist_wheel" + - "build.cmd %PYTHON%\\python.exe setup.py bdist_wheel" # http://stackoverflow.com/questions/43255455/unicode-character-causing-error-with-bdist-wininst-on-python-3-but-not-python-2 # - "python setup.py bdist_wininst" - - "python setup.py bdist_msi" + - "build.cmd %PYTHON%\\python.exe setup.py bdist_msi" - ps: "ls dist" artifacts: diff --git a/build.cmd b/build.cmd new file mode 100644 index 000000000..23df2b69b --- /dev/null +++ b/build.cmd @@ -0,0 +1,21 @@ +@echo off +:: To build extensions for 64 bit Python 3, we need to configure environment +:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: +:: MS Windows SDK for Windows 7 and .NET Framework 4 +:: +:: More details at: +:: https://github.com/cython/cython/wiki/CythonExtensionsOnWindows + +IF "%DISTUTILS_USE_SDK%"=="1" ( + ECHO Configuring environment to build with MSVC on a 64bit architecture + ECHO Using Windows SDK 7.1 + "C:\Program Files\Microsoft SDKs\Windows\v7.1\Setup\WindowsSdkVer.exe" -q -version:v7.1 + CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release + SET MSSdk=1 + REM Need the following to allow tox to see the SDK compiler + SET TOX_TESTENV_PASSENV=DISTUTILS_USE_SDK MSSdk INCLUDE LIB +) ELSE ( + ECHO Using default MSVC build environment +) + +CALL %*