grpc.cmake 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright 2018 Google
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. include(ExternalProject)
  15. if(TARGET grpc)
  16. return()
  17. endif()
  18. ExternalProject_Add(
  19. grpc-download
  20. DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
  21. DOWNLOAD_NAME grpc-1.14.2.tar.gz
  22. URL https://github.com/grpc/grpc/archive/v1.14.2.tar.gz
  23. URL_HASH SHA256=c747e4d903f7dcf803be53abed4e4efc5d3e96f6c274ed1dfca7a03fa6f4e36b
  24. PREFIX ${PROJECT_BINARY_DIR}
  25. SOURCE_DIR ${PROJECT_BINARY_DIR}/src/grpc
  26. CONFIGURE_COMMAND ""
  27. BUILD_COMMAND ""
  28. TEST_COMMAND ""
  29. INSTALL_COMMAND ""
  30. )
  31. # gRPC depends upon these projects, so from an IWYU point of view should
  32. # include these files. Unfortunately gRPC's build requires these to be
  33. # subdirectories in its own source tree and CMake's ExternalProject download
  34. # step clears the source tree so these must be declared to depend upon the grpc
  35. # target. ExternalProject dependencies must already exist when declared so
  36. # these must come after the ExternalProject_Add block above.
  37. include(boringssl)
  38. include(c-ares)
  39. include(protobuf)
  40. include(zlib)
  41. add_custom_target(
  42. grpc
  43. DEPENDS
  44. boringssl
  45. c-ares
  46. grpc-download
  47. protobuf
  48. zlib
  49. )