Эх сурвалжийг харах

Fix other windows version

Bo Yang 7 жил өмнө
parent
commit
4dcdb6bcb2
2 өөрчлөгдсөн 16 нэмэгдсэн , 29 устгасан
  1. 7 12
      appveyor.bat
  2. 9 17
      appveyor.yml

+ 7 - 12
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 ..\..

+ 9 - 17
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