• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1@rem Copyright 2016 gRPC authors.
2@rem
3@rem Licensed under the Apache License, Version 2.0 (the "License");
4@rem you may not use this file except in compliance with the License.
5@rem You may obtain a copy of the License at
6@rem
7@rem     http://www.apache.org/licenses/LICENSE-2.0
8@rem
9@rem Unless required by applicable law or agreed to in writing, software
10@rem distributed under the License is distributed on an "AS IS" BASIS,
11@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12@rem See the License for the specific language governing permissions and
13@rem limitations under the License.
14
15@rem enter this directory
16cd /d %~dp0\..\..\..
17
18@rem TODO(jtattermusch): Kokoro has pre-installed protoc.exe in C:\Program Files\ProtoC and that directory
19@rem is on PATH. To avoid picking up the older version protoc.exe, we change the path to something non-existent.
20set PATH=%PATH:ProtoC=DontPickupProtoC%
21
22@rem Install into ./testinstall, but use absolute path and foward slashes
23set INSTALL_DIR=%cd:\=/%/testinstall
24
25@rem Download OpenSSL-Win32 originally installed from https://slproweb.com/products/Win32OpenSSL.html
26powershell -Command "(New-Object Net.WebClient).DownloadFile('https://storage.googleapis.com/grpc-testing.appspot.com/OpenSSL-Win32-1_1_0g.zip', 'OpenSSL-Win32.zip')"
27powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('OpenSSL-Win32.zip', '.');"
28
29@rem set absolute path to OpenSSL with forward slashes
30set OPENSSL_DIR=%cd:\=/%/OpenSSL-Win32
31
32cd third_party/zlib
33mkdir cmake
34cd cmake
35cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ..
36cmake --build . --config Release --target install || goto :error
37cd ../../..
38
39cd third_party/protobuf/cmake
40mkdir build
41cd build
42cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DZLIB_ROOT=%INSTALL_DIR% -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_TESTS=OFF ..
43cmake --build . --config Release --target install || goto :error
44cd ../../../..
45
46cd third_party/cares/cares
47mkdir cmake
48cd cmake
49cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ..
50cmake --build . --config Release --target install || goto :error
51cd ../../../..
52
53@rem OpenSSL-Win32 and OpenSSL-Win64 can be downloaded from https://slproweb.com/products/Win32OpenSSL.html
54cd cmake
55mkdir build
56cd build
57cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DOPENSSL_ROOT_DIR=%OPENSSL_DIR% -DZLIB_ROOT=%INSTALL_DIR% -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ZLIB_PROVIDER=package -DgRPC_CARES_PROVIDER=package -DgRPC_SSL_PROVIDER=package -DCMAKE_BUILD_TYPE=Release ../.. || goto :error
58cmake --build . --config Release --target install || goto :error
59cd ../..
60
61@rem Build helloworld example using cmake
62cd examples/cpp/helloworld
63mkdir cmake
64cd cmake
65mkdir build
66cd build
67cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DOPENSSL_ROOT_DIR=%OPENSSL_DIR% -DZLIB_ROOT=%INSTALL_DIR% ../.. || goto :error
68cmake --build . --config Release || goto :error
69cd ../../../../..
70
71goto :EOF
72
73:error
74echo Failed!
75exit /b %errorlevel%
76