blob: b7b271c6448918e7976f8d58d01bdfa431e49902 [file] [log] [blame]
Kun Zhang86d64122018-01-05 16:40:20 -08001set PROTOBUF_VER=3.5.1
Eric Andersond04994f2015-09-24 15:27:26 -07002set CMAKE_NAME=cmake-3.3.2-win32-x86
3
Eric Anderson2467d612015-10-22 18:11:44 -07004if not exist "protobuf-%PROTOBUF_VER%\cmake\build\Release\" (
Eric Andersond04994f2015-09-24 15:27:26 -07005 call :installProto
6)
Eric Andersona99e9772015-10-01 11:38:49 -07007
8echo Compile gRPC-Java with something like:
9echo -PtargetArch=x86_32 -PvcProtobufLibs=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\Release -PvcProtobufInclude=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\include
Eric Andersond04994f2015-09-24 15:27:26 -070010goto :eof
11
12
13:installProto
14
15if not exist "%CMAKE_NAME%" (
16 call :installCmake
17)
18set PATH=%PATH%;%cd%\%CMAKE_NAME%\bin
19powershell -command "& { iwr https://github.com/google/protobuf/archive/v%PROTOBUF_VER%.zip -OutFile protobuf.zip }"
Eric Andersonb9278e72017-12-05 13:06:41 -060020powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('protobuf.zip', '.') }"
Eric Andersond04994f2015-09-24 15:27:26 -070021del protobuf.zip
Eric Andersonb1d72e52016-09-27 17:15:12 -070022pushd protobuf-%PROTOBUF_VER%\cmake
Eric Andersond04994f2015-09-24 15:27:26 -070023mkdir build
24cd build
Eric Andersonff7fb5f2016-08-06 08:05:12 -070025cmake -Dprotobuf_BUILD_TESTS=OFF -G "Visual Studio %VisualStudioVersion:~0,2%" ..
Eric Andersond04994f2015-09-24 15:27:26 -070026msbuild /maxcpucount /p:Configuration=Release libprotoc.vcxproj
27call extract_includes.bat
28popd
29goto :eof
30
31
32:installCmake
33
34powershell -command "& { iwr https://cmake.org/files/v3.3/%CMAKE_NAME%.zip -OutFile cmake.zip }"
Eric Andersonb9278e72017-12-05 13:06:41 -060035powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('cmake.zip', '.') }"
Eric Andersond04994f2015-09-24 15:27:26 -070036del cmake.zip
37goto :eof