GoogleTest.podspec 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 = '1.8.0'
  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. :tag => 'release-' + s.version.to_s
  29. }
  30. s.ios.deployment_target = '8.0'
  31. s.requires_arc = false
  32. # Exclude include/gtest/internal/custom files from public headers. These
  33. # files cause problems because they have the same basenames as other headers
  34. # (e.g. gtest.h). We don't need them because they're effectively empty:
  35. # they're compile-time hooks for third-party customization that we don't use.
  36. s.public_header_files = [
  37. 'googlemock/include/gmock/*.h',
  38. 'googlemock/include/gmock/internal/*.h',
  39. 'googletest/include/gtest/*.h',
  40. 'googletest/include/gtest/internal/*.h'
  41. ]
  42. s.header_mappings_dir = 'googletest/include'
  43. # Internal headers accessed only by the implementation. These can't be
  44. # mentioned in source_files because header_mappings_dir will complain about
  45. # headers outside its directory.
  46. s.preserve_paths = [
  47. 'googletest/src/*.h',
  48. ]
  49. s.source_files = [
  50. 'googlemock/src/*.cc',
  51. 'googlemock/include/gmock/*.h',
  52. 'googlemock/include/gmock/internal/*.h',
  53. 'googletest/src/*.cc',
  54. 'googletest/include/gtest/*.h',
  55. 'googletest/include/gtest/internal/*.h'
  56. ]
  57. s.exclude_files = [
  58. # A convenience wrapper for a simple command-line build. If included in
  59. # this build, results in duplicate symbols.
  60. 'googlemock/src/gmock-all.cc',
  61. 'googletest/src/gtest-all.cc',
  62. # Both gmock and gtest define a main function but we only need one.
  63. 'googletest/src/gtest_main.cc',
  64. ]
  65. s.library = 'c++'
  66. # When building this pod there are headers in googletest/src.
  67. s.pod_target_xcconfig = {
  68. 'HEADER_SEARCH_PATHS' =>
  69. '"${PODS_ROOT}/GoogleTest/googlemock/include" ' +
  70. '"${PODS_ROOT}/GoogleTest/googletest/include" ' +
  71. '"${PODS_ROOT}/GoogleTest/googletest"'
  72. }
  73. s.prepare_command = <<-'CMD'
  74. # Remove includes of files in internal/custom
  75. sed -i.bak -e '/include.*internal\/custom/ d' \
  76. googlemock/include/gmock/gmock-matchers.h \
  77. googlemock/include/gmock/gmock-generated-actions.h \
  78. googlemock/include/gmock/internal/gmock-port.h \
  79. googletest/include/gtest/gtest-printers.h \
  80. googletest/include/gtest/internal/gtest-port.h \
  81. googletest/src/gtest-death-test.cc \
  82. googletest/src/gtest.cc
  83. CMD
  84. end