run_distrib_test_cmake_as_externalproject.bat 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. @rem enter this directory
  15. cd /d %~dp0\..\..\..
  16. @rem TODO(jtattermusch): Kokoro has pre-installed protoc.exe in C:\Program Files\ProtoC and that directory
  17. @rem is on PATH. To avoid picking up the older version protoc.exe, we change the path to something non-existent.
  18. set PATH=%PATH:ProtoC=DontPickupProtoC%
  19. @rem Download OpenSSL-Win32 originally installed from https://slproweb.com/products/Win32OpenSSL.html
  20. powershell -Command "(New-Object Net.WebClient).DownloadFile('https://storage.googleapis.com/grpc-testing.appspot.com/OpenSSL-Win32-1_1_0g.zip', 'OpenSSL-Win32.zip')"
  21. powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('OpenSSL-Win32.zip', '.');"
  22. @rem set absolute path to OpenSSL with forward slashes
  23. set OPENSSL_DIR=%cd:\=/%/OpenSSL-Win32
  24. @rem TODO(jtattermusch): add support for GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS env variable
  25. @rem Build helloworld example using cmake
  26. @rem Use non-standard build directory to avoid too long filenames
  27. mkdir example_build
  28. cd example_build
  29. cmake -DOPENSSL_ROOT_DIR=%OPENSSL_DIR% ../examples/cpp/helloworld/cmake_externalproject || goto :error
  30. cmake --build . --config Release || goto :error
  31. cd ..
  32. goto :EOF
  33. :error
  34. echo Failed!
  35. exit /b %errorlevel%