Kun Zhang | 86d6412 | 2018-01-05 16:40:20 -0800 | [diff] [blame^] | 1 | set PROTOBUF_VER=3.5.1 |
Eric Anderson | d04994f | 2015-09-24 15:27:26 -0700 | [diff] [blame] | 2 | set CMAKE_NAME=cmake-3.3.2-win32-x86 |
| 3 | |
Eric Anderson | 2467d61 | 2015-10-22 18:11:44 -0700 | [diff] [blame] | 4 | if not exist "protobuf-%PROTOBUF_VER%\cmake\build\Release\" ( |
Eric Anderson | d04994f | 2015-09-24 15:27:26 -0700 | [diff] [blame] | 5 | call :installProto |
| 6 | ) |
Eric Anderson | a99e977 | 2015-10-01 11:38:49 -0700 | [diff] [blame] | 7 | |
| 8 | echo Compile gRPC-Java with something like: |
| 9 | echo -PtargetArch=x86_32 -PvcProtobufLibs=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\Release -PvcProtobufInclude=%cd%\protobuf-%PROTOBUF_VER%\cmake\build\include |
Eric Anderson | d04994f | 2015-09-24 15:27:26 -0700 | [diff] [blame] | 10 | goto :eof |
| 11 | |
| 12 | |
| 13 | :installProto |
| 14 | |
| 15 | if not exist "%CMAKE_NAME%" ( |
| 16 | call :installCmake |
| 17 | ) |
| 18 | set PATH=%PATH%;%cd%\%CMAKE_NAME%\bin |
| 19 | powershell -command "& { iwr https://github.com/google/protobuf/archive/v%PROTOBUF_VER%.zip -OutFile protobuf.zip }" |
Eric Anderson | b9278e7 | 2017-12-05 13:06:41 -0600 | [diff] [blame] | 20 | powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('protobuf.zip', '.') }" |
Eric Anderson | d04994f | 2015-09-24 15:27:26 -0700 | [diff] [blame] | 21 | del protobuf.zip |
Eric Anderson | b1d72e5 | 2016-09-27 17:15:12 -0700 | [diff] [blame] | 22 | pushd protobuf-%PROTOBUF_VER%\cmake |
Eric Anderson | d04994f | 2015-09-24 15:27:26 -0700 | [diff] [blame] | 23 | mkdir build |
| 24 | cd build |
Eric Anderson | ff7fb5f | 2016-08-06 08:05:12 -0700 | [diff] [blame] | 25 | cmake -Dprotobuf_BUILD_TESTS=OFF -G "Visual Studio %VisualStudioVersion:~0,2%" .. |
Eric Anderson | d04994f | 2015-09-24 15:27:26 -0700 | [diff] [blame] | 26 | msbuild /maxcpucount /p:Configuration=Release libprotoc.vcxproj |
| 27 | call extract_includes.bat |
| 28 | popd |
| 29 | goto :eof |
| 30 | |
| 31 | |
| 32 | :installCmake |
| 33 | |
| 34 | powershell -command "& { iwr https://cmake.org/files/v3.3/%CMAKE_NAME%.zip -OutFile cmake.zip }" |
Eric Anderson | b9278e7 | 2017-12-05 13:06:41 -0600 | [diff] [blame] | 35 | powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('cmake.zip', '.') }" |
Eric Anderson | d04994f | 2015-09-24 15:27:26 -0700 | [diff] [blame] | 36 | del cmake.zip |
| 37 | goto :eof |