aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Yang <paulyang1211@gmail.com>2018-02-27 11:11:06 -0800
committerBo Yang <paulyang1211@gmail.com>2018-02-27 15:21:53 -0800
commit3952ea9c0723a35c3171d7bbbdbc5dc41a7e2d25 (patch)
tree5147f96e1fcbf949b7d544e5eaf1cf8bb9baa5e7
parent45f58d40b06405bd4e027747017766ee5e08205d (diff)
downloadprotobuf-3952ea9c0723a35c3171d7bbbdbc5dc41a7e2d25.tar.gz
protobuf-3952ea9c0723a35c3171d7bbbdbc5dc41a7e2d25.tar.bz2
protobuf-3952ea9c0723a35c3171d7bbbdbc5dc41a7e2d25.zip
Install cmake
-rw-r--r--appveyor.bat45
-rw-r--r--appveyor.yml21
2 files changed, 48 insertions, 18 deletions
diff --git a/appveyor.bat b/appveyor.bat
index a189b84f..9605561c 100644
--- a/appveyor.bat
+++ b/appveyor.bat
@@ -1,23 +1,34 @@
setlocal
-echo %PATH%
pip install wheel
cd %REPO_DIR%
git checkout %BUILD_COMMIT%
-mingw-get
-sh autogen.sh
-
-REM cd python
-REM sed -i '/Wno-sign-compare/a \ \ \ \ extra_compile_args.append(\'-D_hypot=hypot\')' setup.py
-REM cat setup.py
-REM
-REM REM sed -i 's/\[\'-Wno-write-strings\',/\[\]/g' setup.py
-REM REM sed -i '/Wno-invalid-offsetof/d' setup.py
-REM REM sed -i '/Wno-sign-compare/d' setup.py
-REM
-REM dir %MINGW%
-REM set path
-REM gcc
-REM %MINGW%\gcc
-REM python setup.py bdist_wheel --cpp_implementation --compile_static_extension
+
+REM Build protobuf library
+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
+
+dir %MINGW%
+set path
+gcc
+%MINGW%\gcc
+python setup.py bdist_wheel --cpp_implementation --compile_static_extension
+dir dist
+cd ..\..
diff --git a/appveyor.yml b/appveyor.yml
index af0a32a7..bd5819f4 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -10,6 +10,8 @@ environment:
PROTOC_VERSION: 3.5.1
MINGW_32: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
MINGW_64: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin
+ BUILD_DLL: OFF
+ UNICODE: ON
# NP_BUILD_DEP: "numpy==1.10.4"
# NP_TEST_DEP: "numpy==1.10.4"
# OTHER_BUILD_DEP: "cython jinja2"
@@ -55,6 +57,7 @@ matrix:
install:
# Fetch submodules
- git submodule update --init --recursive
+
# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
@@ -88,6 +91,22 @@ install:
- echo.compiler = mingw32 >> C:\Python27\Lib\distutils\distutils.cfg
- cat "C:\Python27\Lib\distutils\distutils.cfg"
+ # Install zlib
+ - mkdir zlib
+ - curl -L -o zlib.zip http://www.winimage.com/zLibDll/zlib123dll.zip
+ - curl -L -o zlib-src.zip http://www.winimage.com/zLibDll/zlib123.zip
+ - 7z x zlib.zip -ozlib
+ - 7z x zlib-src.zip -ozlib\include
+ - SET ZLIB_ROOT=%cd%\zlib
+ - del /Q zlib.zip
+ - 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
+
build_script:
- CALL appveyor.bat
# # Install the dependencies of the project.
@@ -117,7 +136,7 @@ test_script:
# - cd ..
artifacts:
- - path: "%REPO_DIR%\\dist\\*"
+ - path: "%REPO_DIR%\\python\\dist\\*"
on_success:
# # Upload the generated wheel package to Rackspace