GoogleTest.podspec 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Copyright 2017 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. # A Private podspec for GoogleTest. Suitable only for use inside this source
  15. # tree.
  16. Pod::Spec.new do |s|
  17. s.name = 'GoogleTest'
  18. s.version = '99.99.99'
  19. s.summary = 'Google Test'
  20. s.description = <<-DESC
  21. Google's C++ test framework.
  22. DESC
  23. s.homepage = 'https://github.com/google/googletest/'
  24. s.license = 'BSD'
  25. s.authors = 'Google, Inc.'
  26. s.source = {
  27. :git => 'https://github.com/google/googletest.git',
  28. :commit => 'bf66935e07825318ae519675d73d0f3e313b3ec6'
  29. }
  30. s.ios.deployment_target = '15.0'
  31. s.osx.deployment_target = '10.15'
  32. s.tvos.deployment_target = '15.0'
  33. s.requires_arc = false
  34. # Exclude include/gtest/internal/custom files from public headers. These
  35. # files cause problems because they have the same basenames as other headers
  36. # (e.g. gtest.h). We don't need them because they're effectively empty:
  37. # they're compile-time hooks for third-party customization that we don't use.
  38. s.public_header_files = [
  39. 'googlemock/include/gmock/*.h',
  40. 'googlemock/include/gmock/internal/*.h',
  41. 'googletest/include/gtest/*.h',
  42. 'googletest/include/gtest/internal/*.h'
  43. ]
  44. s.header_mappings_dir = 'googletest/include'
  45. # Internal headers accessed only by the implementation. These can't be
  46. # mentioned in source_files because header_mappings_dir will complain about
  47. # headers outside its directory.
  48. s.preserve_paths = [
  49. 'googletest/src/*.h',
  50. ]
  51. s.source_files = [
  52. 'googlemock/src/*.cc',
  53. 'googlemock/include/gmock/*.h',
  54. 'googlemock/include/gmock/internal/*.h',
  55. 'googletest/src/*.cc',
  56. 'googletest/include/gtest/*.h',
  57. 'googletest/include/gtest/internal/*.h'
  58. ]
  59. s.exclude_files = [
  60. # A convenience wrapper for a simple command-line build. If included in
  61. # this build, results in duplicate symbols.
  62. 'googlemock/src/gmock-all.cc',
  63. 'googletest/src/gtest-all.cc',
  64. # Both gmock and gtest define a main function but we only need one.
  65. 'googletest/src/gtest_main.cc',
  66. ]
  67. s.library = 'c++'
  68. # When building this pod there are headers in googletest/src.
  69. s.pod_target_xcconfig = {
  70. 'HEADER_SEARCH_PATHS' =>
  71. '"${PODS_ROOT}/GoogleTest/googlemock/include" ' +
  72. '"${PODS_ROOT}/GoogleTest/googletest/include" ' +
  73. '"${PODS_ROOT}/GoogleTest/googletest"'
  74. }
  75. s.compiler_flags = '$(inherited) -Wno-comma'
  76. s.prepare_command = <<-'CMD'
  77. # Remove includes of files in internal/custom
  78. sed -i.bak -e '/include.*internal\/custom/ d' \
  79. googlemock/include/gmock/gmock-matchers.h \
  80. googlemock/include/gmock/gmock-more-actions.h \
  81. googlemock/include/gmock/internal/gmock-port.h \
  82. googletest/include/gtest/gtest-printers.h \
  83. googletest/include/gtest/internal/gtest-port.h \
  84. googletest/src/gtest-death-test.cc \
  85. googletest/src/gtest.cc
  86. CMD
  87. end