gtest.gyp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # Copyright 2013 Google Inc. All Rights Reserved.
  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. {
  15. 'targets': [
  16. {
  17. 'target_name': 'gtest',
  18. 'type': 'static_library',
  19. 'include_dirs': [
  20. 'third_party/gtest',
  21. 'third_party/gtest/include',
  22. ],
  23. 'link_settings': {
  24. 'ldflags': ['-lpthread'],
  25. },
  26. 'dependencies': [
  27. 'gtest_prod',
  28. ],
  29. 'sources': [
  30. 'third_party/gtest/include/gtest/gtest-death-test.h',
  31. 'third_party/gtest/include/gtest/gtest-message.h',
  32. 'third_party/gtest/include/gtest/gtest-param-test.h',
  33. 'third_party/gtest/include/gtest/gtest-printers.h',
  34. 'third_party/gtest/include/gtest/gtest-spi.h',
  35. 'third_party/gtest/include/gtest/gtest-test-part.h',
  36. 'third_party/gtest/include/gtest/gtest-typed-test.h',
  37. 'third_party/gtest/include/gtest/gtest.h',
  38. 'third_party/gtest/include/gtest/gtest_pred_impl.h',
  39. 'third_party/gtest/include/gtest/internal/gtest-death-test-internal.h',
  40. 'third_party/gtest/include/gtest/internal/gtest-filepath.h',
  41. 'third_party/gtest/include/gtest/internal/gtest-internal.h',
  42. 'third_party/gtest/include/gtest/internal/gtest-linked_ptr.h',
  43. 'third_party/gtest/include/gtest/internal/gtest-param-util-generated.h',
  44. 'third_party/gtest/include/gtest/internal/gtest-param-util.h',
  45. 'third_party/gtest/include/gtest/internal/gtest-port.h',
  46. 'third_party/gtest/include/gtest/internal/gtest-string.h',
  47. 'third_party/gtest/include/gtest/internal/gtest-tuple.h',
  48. 'third_party/gtest/include/gtest/internal/gtest-type-util.h',
  49. 'third_party/gtest/src/gtest-all.cc',
  50. 'third_party/gtest/src/gtest-death-test.cc',
  51. 'third_party/gtest/src/gtest-filepath.cc',
  52. 'third_party/gtest/src/gtest-internal-inl.h',
  53. 'third_party/gtest/src/gtest-port.cc',
  54. 'third_party/gtest/src/gtest-printers.cc',
  55. 'third_party/gtest/src/gtest-test-part.cc',
  56. 'third_party/gtest/src/gtest-typed-test.cc',
  57. 'third_party/gtest/src/gtest.cc',
  58. ],
  59. 'sources!': [
  60. 'third_party/gtest/src/gtest-all.cc', # Not needed by our build.
  61. ],
  62. 'conditions': [
  63. ['OS == "mac" or OS == "ios"', {
  64. 'sources': [
  65. 'gtest_mac.h',
  66. 'gtest_mac.mm',
  67. 'platform_test_mac.mm'
  68. ],
  69. 'link_settings': {
  70. 'libraries': [
  71. '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
  72. ],
  73. },
  74. }],
  75. ['OS=="win" and (MSVS_VERSION=="2012" or MSVS_VERSION=="2012e")', {
  76. 'defines': [
  77. '_VARIADIC_MAX=10',
  78. ],
  79. 'direct_dependent_settings': {
  80. 'defines': [
  81. '_VARIADIC_MAX=10',
  82. ],
  83. },
  84. }],
  85. ],
  86. 'direct_dependent_settings': {
  87. 'defines': [
  88. 'UNIT_TEST',
  89. ],
  90. 'include_dirs': [
  91. 'third_party/gtest/include', # So that gtest headers can find themselves.
  92. ],
  93. 'target_conditions': [
  94. ['_type=="executable"', {
  95. 'test': 1,
  96. 'conditions': [
  97. ['OS=="mac"', {
  98. 'run_as': {
  99. 'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'],
  100. },
  101. }],
  102. ['OS=="win"', {
  103. 'run_as': {
  104. 'action????': ['$(TargetPath)', '--gtest_print_time'],
  105. },
  106. }],
  107. ],
  108. }],
  109. ],
  110. 'msvs_disabled_warnings': [4800],
  111. },
  112. },
  113. {
  114. 'target_name': 'gtest_main',
  115. 'type': 'static_library',
  116. 'dependencies': [
  117. 'gtest',
  118. ],
  119. 'sources': [
  120. 'third_party/gtest/src/gtest_main.cc',
  121. ],
  122. },
  123. {
  124. 'target_name': 'gtest_prod',
  125. 'toolsets': ['host', 'target'],
  126. 'type': 'none',
  127. 'sources': [
  128. 'third_party/gtest/include/gtest/gtest_prod.h',
  129. ],
  130. },
  131. ],
  132. }