@ -31,38 +31,40 @@ set OPENSSL_DIR=%cd:\=/%/OpenSSL-Win32
@ rem TODO(jtattermusch): add support for GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS env variable
set VS_GENERATOR = " Visual Studio 15 2017 "
@ rem Install absl
mkdir third_party\abseil-cpp\cmake\build
pushd third_party\abseil-cpp\cmake\build
cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ..\..
cmake -G %VS_GENERATOR% - DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ..\..
cmake --build . --config Release --target install || goto : error
popd
@ rem Install c-ares
mkdir third_party\cares\cares\cmake\build
pushd third_party\cares\cares\cmake\build
cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ..\..
cmake -G %VS_GENERATOR% - DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ..\..
cmake --build . --config Release --target install || goto : error
popd
@ rem Install protobuf
mkdir third_party\protobuf\cmake\build
pushd third_party\protobuf\cmake\build
cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DZLIB_ROOT=%INSTALL_DIR% -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_TESTS=OFF ..
cmake -G %VS_GENERATOR% - DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DZLIB_ROOT=%INSTALL_DIR% -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_TESTS=OFF ..
cmake --build . --config Release --target install || goto : error
popd
@ rem Install re2
mkdir third_party\re2\cmake\build
pushd third_party\re2\cmake\build
cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ..\..
cmake -G %VS_GENERATOR% - DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ..\..
cmake --build . --config Release --target install || goto : error
popd
@ rem Install zlib
mkdir third_party\zlib\cmake\build
pushd third_party\zlib\cmake\build
cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ..\..
cmake -G %VS_GENERATOR% - DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ..\..
cmake --build . --config Release --target install || goto : error
popd
@ -75,9 +77,16 @@ popd
git submodule foreach bash -c " cd $toplevel; rm -rf $name "
@ rem Install gRPC
@ rem NOTE(jtattermusch): The -DProtobuf_USE_STATIC_LIBS=ON is necessary on cmake3.16+
@ rem since by default "find_package(Protobuf ...)" uses the cmake's builtin
@ rem FindProtobuf.cmake module, which now requires the info whether protobuf
@ rem is to be linked statically.
@ rem See https://github.com/Kitware/CMake/commit/3bbd85d5fffe66181cf16c81b23b2ba50f5387ba
@ rem See https://gitlab.kitware.com/cmake/cmake/-/merge_requests/3555#note_660390
mkdir cmake\build
pushd cmake\build
cmake ^
-G %VS_GENERATOR% ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ^
-DOPENSSL_ROOT_DIR=%OPENSSL_DIR% ^
@ -88,6 +97,7 @@ cmake ^
-DgRPC_ABSL_PROVIDER=package ^
-DgRPC_CARES_PROVIDER=package ^
-DgRPC_PROTOBUF_PROVIDER=package ^
-DProtobuf_USE_STATIC_LIBS=ON ^
-DgRPC_RE2_PROVIDER=package ^
-DgRPC_SSL_PROVIDER=package ^
-DgRPC_ZLIB_PROVIDER=package ^
@ -98,7 +108,7 @@ popd
@ rem Build helloworld example using cmake
mkdir examples\cpp\helloworld\cmake\build
pushd examples\cpp\helloworld\cmake\build
cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DOPENSSL_ROOT_DIR=%OPENSSL_DIR% -DZLIB_ROOT=%INSTALL_DIR% ../.. || goto : error
cmake -G %VS_GENERATOR% - DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DOPENSSL_ROOT_DIR=%OPENSSL_DIR% -DZLIB_ROOT=%INSTALL_DIR% ../.. || goto : error
cmake --build . --config Release || goto : error
popd