2018-01-06 08:40:20 +08:00
|
|
|
set PROTOBUF_VER=3.5.1
|
2015-09-25 06:27:26 +08:00
|
|
|
set CMAKE_NAME=cmake-3.3.2-win32-x86
|
|
|
|
|
2015-10-23 09:11:44 +08:00
|
|
|
if not exist "protobuf-%PROTOBUF_VER%\cmake\build\Release\" (
|
2015-09-25 06:27:26 +08:00
|
|
|
call :installProto
|
|
|
|
)
|
2015-10-02 02:38:49 +08:00
|
|
|
|
|
|
|
echo Compile gRPC-Java with something like:
|
|
|
|
echo -PtargetArch=x86_32 -PvcProtobufLibs=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\Release -PvcProtobufInclude=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\include
|
2015-09-25 06:27:26 +08:00
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
|
|
:installProto
|
|
|
|
|
2018-02-06 03:13:50 +08:00
|
|
|
where /q cmake
|
|
|
|
if not ERRORLEVEL 1 goto :hasCmake
|
2015-09-25 06:27:26 +08:00
|
|
|
if not exist "%CMAKE_NAME%" (
|
|
|
|
call :installCmake
|
|
|
|
)
|
|
|
|
set PATH=%PATH%;%cd%\%CMAKE_NAME%\bin
|
2018-02-06 03:13:50 +08:00
|
|
|
:hasCmake
|
2018-02-24 05:06:29 +08:00
|
|
|
@rem GitHub requires TLSv1.2, and for whatever reason our powershell doesn't have it enabled
|
|
|
|
powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; iwr https://github.com/google/protobuf/archive/v%PROTOBUF_VER%.zip -OutFile protobuf.zip }"
|
2017-12-06 03:06:41 +08:00
|
|
|
powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('protobuf.zip', '.') }"
|
2015-09-25 06:27:26 +08:00
|
|
|
del protobuf.zip
|
2016-09-28 08:15:12 +08:00
|
|
|
pushd protobuf-%PROTOBUF_VER%\cmake
|
2015-09-25 06:27:26 +08:00
|
|
|
mkdir build
|
|
|
|
cd build
|
2016-08-06 23:05:12 +08:00
|
|
|
cmake -Dprotobuf_BUILD_TESTS=OFF -G "Visual Studio %VisualStudioVersion:~0,2%" ..
|
2015-09-25 06:27:26 +08:00
|
|
|
msbuild /maxcpucount /p:Configuration=Release libprotoc.vcxproj
|
|
|
|
call extract_includes.bat
|
|
|
|
popd
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
|
|
:installCmake
|
|
|
|
|
|
|
|
powershell -command "& { iwr https://cmake.org/files/v3.3/%CMAKE_NAME%.zip -OutFile cmake.zip }"
|
2017-12-06 03:06:41 +08:00
|
|
|
powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('cmake.zip', '.') }"
|
2015-09-25 06:27:26 +08:00
|
|
|
del cmake.zip
|
|
|
|
goto :eof
|