diff --git a/test/distrib/cpp/run_distrib_test_cmake.bat b/test/distrib/cpp/run_distrib_test_cmake.bat index 7658156be1d..48d510100e2 100644 --- a/test/distrib/cpp/run_distrib_test_cmake.bat +++ b/test/distrib/cpp/run_distrib_test_cmake.bat @@ -29,44 +29,55 @@ powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [Sys @rem set absolute path to OpenSSL with forward slashes set OPENSSL_DIR=%cd:\=/%/OpenSSL-Win32 -cd third_party/zlib -mkdir cmake -cd cmake -cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% .. +@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 --build . --config Release --target install || goto :error -cd ../../.. +popd -cd third_party/protobuf/cmake -mkdir build -cd build +@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 --build . --config Release --target install || goto :error -cd ../../../.. +popd -cd third_party/cares/cares -mkdir cmake -cd cmake -cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% .. +@rem Install zlib +mkdir third_party\zlib\cmake\build +pushd third_party\zlib\cmake\build +cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ..\.. cmake --build . --config Release --target install || goto :error -cd ../../../.. +popd -@rem OpenSSL-Win32 and OpenSSL-Win64 can be downloaded from https://slproweb.com/products/Win32OpenSSL.html -cd cmake -mkdir build -cd build -cmake -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 +@rem Just before installing gRPC, wipe out contents of all the submodules to simulate +@rem a standalone build from an archive +git submodule deinit --all --force + +@rem Install gRPC +mkdir cmake\build +pushd cmake\build +cmake ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ^ + -DOPENSSL_ROOT_DIR=%OPENSSL_DIR% ^ + -DZLIB_ROOT=%INSTALL_DIR% ^ + -DgRPC_INSTALL=ON ^ + -DgRPC_BUILD_TESTS=OFF ^ + -DgRPC_CARES_PROVIDER=package ^ + -DgRPC_PROTOBUF_PROVIDER=package ^ + -DgRPC_SSL_PROVIDER=package ^ + -DgRPC_ZLIB_PROVIDER=package ^ + ../.. || goto :error cmake --build . --config Release --target install || goto :error -cd ../.. +popd @rem Build helloworld example using cmake -cd examples/cpp/helloworld -mkdir cmake -cd cmake -mkdir build -cd build +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 --build . --config Release || goto :error -cd ../../../../.. +popd goto :EOF diff --git a/test/distrib/cpp/run_distrib_test_cmake.sh b/test/distrib/cpp/run_distrib_test_cmake.sh index a73cbdf1f0b..457b65ffcb3 100755 --- a/test/distrib/cpp/run_distrib_test_cmake.sh +++ b/test/distrib/cpp/run_distrib_test_cmake.sh @@ -24,33 +24,25 @@ apt-get update apt-get install -t jessie-backports -y libssl-dev # Install c-ares -cd third_party/cares/cares -git fetch origin -git checkout cares-1_15_0 -mkdir -p cmake/build -cd cmake/build +mkdir -p "third_party/cares/cares/cmake/build" +pushd "third_party/cares/cares/cmake/build" cmake -DCMAKE_BUILD_TYPE=Release ../.. make -j4 install -cd ../../../../.. -rm -rf third_party/cares/cares # wipe out to prevent influencing the grpc build - -# Install zlib -cd third_party/zlib -mkdir -p cmake/build -cd cmake/build -cmake -DCMAKE_BUILD_TYPE=Release ../.. -make -j4 install -cd ../../../.. -rm -rf third_party/zlib # wipe out to prevent influencing the grpc build +popd # Install protobuf -cd third_party/protobuf -mkdir -p cmake/build -cd cmake/build +mkdir -p "third_party/protobuf/cmake/build" +pushd "third_party/protobuf/cmake/build" cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release .. make -j4 install -cd ../../../.. -rm -rf third_party/protobuf # wipe out to prevent influencing the grpc build +popd + +# Install zlib +mkdir -p "third_party/zlib/cmake/build" +pushd "third_party/zlib/cmake/build" +cmake -DCMAKE_BUILD_TYPE=Release ../.. +make -j4 install +popd # Just before installing gRPC, wipe out contents of all the submodules to simulate # a standalone build from an archive @@ -58,15 +50,23 @@ rm -rf third_party/protobuf # wipe out to prevent influencing the grpc build git submodule foreach 'cd $toplevel; rm -rf $name' # Install gRPC -mkdir -p cmake/build -cd cmake/build -cmake -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 ../.. +mkdir -p "cmake/build" +pushd "cmake/build" +cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DgRPC_INSTALL=ON \ + -DgRPC_BUILD_TESTS=OFF \ + -DgRPC_CARES_PROVIDER=package \ + -DgRPC_PROTOBUF_PROVIDER=package \ + -DgRPC_SSL_PROVIDER=package \ + -DgRPC_ZLIB_PROVIDER=package \ + ../.. make -j4 install -cd ../.. +popd # Build helloworld example using cmake -cd examples/cpp/helloworld -mkdir -p cmake/build -cd cmake/build +mkdir -p "examples/cpp/helloworld/cmake/build" +pushd "examples/cpp/helloworld/cmake/build" cmake ../.. make +popd diff --git a/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh b/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh index e78b1997cf7..6f98f3e72c4 100755 --- a/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh +++ b/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh @@ -24,33 +24,25 @@ apt-get update apt-get install -t jessie-backports -y libssl-dev pkg-config # Install c-ares -cd third_party/cares/cares -git fetch origin -git checkout cares-1_15_0 -mkdir -p cmake/build -cd cmake/build +mkdir -p "third_party/cares/cares/cmake/build" +pushd "third_party/cares/cares/cmake/build" cmake -DCMAKE_BUILD_TYPE=Release ../.. make -j4 install -cd ../../../../.. -rm -rf third_party/cares/cares # wipe out to prevent influencing the grpc build - -# Install zlib -cd third_party/zlib -mkdir -p cmake/build -cd cmake/build -cmake -DCMAKE_BUILD_TYPE=Release ../.. -make -j4 install -cd ../../../.. -rm -rf third_party/zlib # wipe out to prevent influencing the grpc build +popd # Install protobuf -cd third_party/protobuf -mkdir -p cmake/build -cd cmake/build +mkdir -p "third_party/protobuf/cmake/build" +pushd "third_party/protobuf/cmake/build" cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release .. make -j4 install -cd ../../../.. -rm -rf third_party/protobuf # wipe out to prevent influencing the grpc build +popd + +# Install zlib +mkdir -p "third_party/zlib/cmake/build" +pushd "third_party/zlib/cmake/build" +cmake -DCMAKE_BUILD_TYPE=Release ../.. +make -j4 install +popd # Just before installing gRPC, wipe out contents of all the submodules to simulate # a standalone build from an archive @@ -58,11 +50,20 @@ rm -rf third_party/protobuf # wipe out to prevent influencing the grpc build git submodule foreach 'cd $toplevel; rm -rf $name' # Install gRPC -mkdir -p cmake/build -cd cmake/build -cmake -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 -DCMAKE_INSTALL_PREFIX=/usr/local/grpc ../.. +mkdir -p "cmake/build" +pushd "cmake/build" +cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local/grpc \ + -DgRPC_INSTALL=ON \ + -DgRPC_BUILD_TESTS=OFF \ + -DgRPC_CARES_PROVIDER=package \ + -DgRPC_PROTOBUF_PROVIDER=package \ + -DgRPC_SSL_PROVIDER=package \ + -DgRPC_ZLIB_PROVIDER=package \ + ../.. make -j4 install -cd ../.. +popd # Build helloworld example using Makefiles and pkg-config cd examples/cpp/helloworld