gRPC-Core.podspec.template 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. %YAML 1.2
  2. --- |
  3. # GRPC CocoaPods podspec
  4. # This file has been automatically generated from a template file.
  5. # Please look at the templates directory instead.
  6. # This file can be regenerated from the template by running
  7. # tools/buildgen/generate_projects.sh
  8. # Copyright 2015, Google Inc.
  9. # All rights reserved.
  10. #
  11. # Redistribution and use in source and binary forms, with or without
  12. # modification, are permitted provided that the following conditions are
  13. # met:
  14. #
  15. # * Redistributions of source code must retain the above copyright
  16. # notice, this list of conditions and the following disclaimer.
  17. # * Redistributions in binary form must reproduce the above
  18. # copyright notice, this list of conditions and the following disclaimer
  19. # in the documentation and/or other materials provided with the
  20. # distribution.
  21. # * Neither the name of Google Inc. nor the names of its
  22. # contributors may be used to endorse or promote products derived from
  23. # this software without specific prior written permission.
  24. #
  25. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  26. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  27. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  28. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  29. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  30. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  31. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  32. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  33. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  34. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  35. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  36. <%!
  37. def grpc_files(libs):
  38. out = []
  39. for lib in libs:
  40. if lib.name in ("grpc", "gpr"):
  41. out += lib.get('headers', [])
  42. out += lib.get('public_headers', [])
  43. out += lib.get('src', [])
  44. return out;
  45. def grpc_private_headers(libs):
  46. out = []
  47. for lib in libs:
  48. if lib.name in ("grpc", "gpr"):
  49. out += lib.get('headers', [])
  50. return out
  51. %>
  52. Pod::Spec.new do |s|
  53. s.name = 'gRPC-Core'
  54. version = '0.14.0'
  55. s.version = version
  56. s.summary = 'Core cross-platform gRPC library, written in C'
  57. s.homepage = 'http://www.grpc.io'
  58. s.license = 'New BSD'
  59. s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' }
  60. s.source = {
  61. :git => 'https://github.com/grpc/grpc.git',
  62. :tag => "release-#{version.gsub(/\./, '_')}-objectivec-#{version}",
  63. }
  64. s.ios.deployment_target = '7.1'
  65. s.osx.deployment_target = '10.9'
  66. s.requires_arc = false
  67. name = 'grpc'
  68. s.module_name = name
  69. s.header_dir = name
  70. s.module_map = 'include/grpc/module.modulemap'
  71. s.source_files = ${(',\n' + 19*' ').join('\'%s\'' % f for f in grpc_files(libs))}
  72. s.private_header_files = ${(',\n' + 27*' ').join('\'%s\'' % f for f in grpc_private_headers(libs))}
  73. s.header_mappings_dir = 'include/grpc'
  74. src_root = '$(PODS_ROOT)/gRPC-Core'
  75. # This isn't officially supported in Cocoapods. We've asked for an alternative:
  76. # https://github.com/CocoaPods/CocoaPods/issues/4386
  77. public_build_settings = {
  78. 'GRPC_SRC_ROOT' => src_root,
  79. 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
  80. }
  81. private_build_settings = public_build_settings.merge({
  82. 'USE_HEADERMAP' => 'NO',
  83. 'ALWAYS_SEARCH_USER_PATHS' => 'NO',
  84. 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
  85. })
  86. s.user_target_xcconfig = public_build_settings
  87. s.pod_target_xcconfig = private_build_settings
  88. s.libraries = 'z'
  89. s.dependency 'BoringSSL', '~> 3.0'
  90. end