From 4dcdb6bcb2a7e67afeecea070065c6fdf40ed30b Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Tue, 27 Feb 2018 16:19:08 -0800 Subject: Fix other windows version --- appveyor.bat | 19 +++++++------------ appveyor.yml | 26 +++++++++----------------- 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/appveyor.bat b/appveyor.bat index 9605561c..05db08e6 100644 --- a/appveyor.bat +++ b/appveyor.bat @@ -1,7 +1,9 @@ setlocal +dir %MINGW% pip install wheel +REM Checkout release commit cd %REPO_DIR% git checkout %BUILD_COMMIT% @@ -10,25 +12,18 @@ mkdir src\.libs pushd src\.libs cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -DZLIB_ROOT=%ZLIB_ROOT% -Dprotobuf_BUILD_TESTS=OFF -D"CMAKE_MAKE_PROGRAM:PATH=%MINGW%/mingw32-make.exe" ../../cmake mingw32-make -dir popd REM Build python library cd python - sed -i '/Wno-sign-compare/a \ \ \ \ extra_compile_args.append(\'-D_hypot=hypot\')' setup.py sed -i 's/\'-DPYTHON_PROTO2_CPP_IMPL_V2\'/\'-DPYTHON_PROTO2_CPP_IMPL_V2\',\'-D_hypot=hypot\'/g' setup.py -cat setup.py - -REM sed -i 's/\[\'-Wno-write-strings\',/\[\]/g' setup.py -REM sed -i '/Wno-invalid-offsetof/d' setup.py -REM sed -i '/Wno-sign-compare/d' setup.py +IF NOT %PYTHON_ARCH%==64 GOTO no_win64_change +sed -i '/Wno-sign-compare/a \ \ \ \ extra_compile_args.append(\'-DMS_WIN64\')' setup.py +sed -i 's/\'-DPYTHON_PROTO2_CPP_IMPL_V2\'/\'-DPYTHON_PROTO2_CPP_IMPL_V2\',\'-DMS_WIN64\'/g' setup.py +:no_win64_change -dir %MINGW% -set path -gcc -%MINGW%\gcc +cat setup.py python setup.py bdist_wheel --cpp_implementation --compile_static_extension -dir dist cd ..\.. diff --git a/appveyor.yml b/appveyor.yml index bd5819f4..3900829a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -77,19 +77,6 @@ install: - 7z x protoc-%PROTOC_VERSION%.zip - del /Q protoc-%PROTOC_VERSION%.zip - SET PATH=%cd%\bin;%PATH% - # - IF "%PYTHON_ARCH%"=="32" ( - # SET MINGW=%MINGW_32% - # ) ELSE ( - # SET MINGW=%MINGW_64% - # ) - - SET MINGW=%MINGW_32% - - echo %MINGW% - - echo %PYTHON% - - SET PATH=%MINGW%;%PATH% - - dir %MINGW% - - echo [build] > C:\Python27\Lib\distutils\distutils.cfg - - echo.compiler = mingw32 >> C:\Python27\Lib\distutils\distutils.cfg - - cat "C:\Python27\Lib\distutils\distutils.cfg" # Install zlib - mkdir zlib @@ -102,10 +89,15 @@ install: - del /Q zlib-src.zip before_build: - - if %PYTHON_VERSION%==2.7 set generator=MSYS Makefiles - - if %PYTHON_VERSION%==3.4 set generator=MSYS Makefiles - - if %PYTHON_VERSION%==3.5 set generator=Visual Studio 14 - - if %PYTHON_VERSION%==3.6 set generator=Visual Studio 14 + - if %PYTHON_VERSION%==2.7 set generator=MSYS Makefiles + - if %PYTHON_VERSION%==3.4 set generator=MSYS Makefiles + - if %PYTHON_VERSION%==3.5 set generator=Visual Studio 14 + - if %PYTHON_VERSION%==3.6 set generator=Visual Studio 14 + - if %PYTHON_ARCH%==32 set MINGW=%MINGW_32% + - if %PYTHON_ARCH%==64 set MINGW=%MINGW_64% + - set PATH=%MINGW%;%PATH% + - echo [build] > %PYTHON%\Lib\distutils\distutils.cfg + - echo.compiler = mingw32 >> %PYTHON%\Lib\distutils\distutils.cfg build_script: - CALL appveyor.bat -- cgit v1.2.3