libyuv_test.gyp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. # Copyright 2011 The LibYuv Project Authors. All rights reserved.
  2. #
  3. # Use of this source code is governed by a BSD-style license
  4. # that can be found in the LICENSE file in the root of the source
  5. # tree. An additional intellectual property rights grant can be found
  6. # in the file PATENTS. All contributing project authors may
  7. # be found in the AUTHORS file in the root of the source tree.
  8. {
  9. 'variables': {
  10. 'libyuv_disable_jpeg%': 0,
  11. 'mips_msa%': 0, # Default to msa off.
  12. },
  13. 'targets': [
  14. {
  15. 'target_name': 'libyuv_unittest',
  16. 'type': '<(gtest_target_type)',
  17. 'dependencies': [
  18. 'libyuv.gyp:libyuv',
  19. 'testing/gtest.gyp:gtest',
  20. 'third_party/gflags/gflags.gyp:gflags',
  21. ],
  22. 'direct_dependent_settings': {
  23. 'defines': [
  24. 'GTEST_RELATIVE_PATH',
  25. ],
  26. },
  27. 'export_dependent_settings': [
  28. '<(DEPTH)/testing/gtest.gyp:gtest',
  29. ],
  30. 'sources': [
  31. # headers
  32. 'unit_test/unit_test.h',
  33. # sources
  34. 'unit_test/basictypes_test.cc',
  35. 'unit_test/compare_test.cc',
  36. 'unit_test/color_test.cc',
  37. 'unit_test/convert_test.cc',
  38. 'unit_test/cpu_test.cc',
  39. 'unit_test/math_test.cc',
  40. 'unit_test/planar_test.cc',
  41. 'unit_test/rotate_argb_test.cc',
  42. 'unit_test/rotate_test.cc',
  43. 'unit_test/scale_argb_test.cc',
  44. 'unit_test/scale_test.cc',
  45. 'unit_test/unit_test.cc',
  46. 'unit_test/video_common_test.cc',
  47. ],
  48. 'conditions': [
  49. ['OS=="linux"', {
  50. 'cflags': [
  51. '-fexceptions',
  52. ],
  53. }],
  54. [ 'OS == "ios"', {
  55. 'xcode_settings': {
  56. 'DEBUGGING_SYMBOLS': 'YES',
  57. 'DEBUG_INFORMATION_FORMAT' : 'dwarf-with-dsym',
  58. # Work around compile issue with isosim.mm, see
  59. # https://code.google.com/p/libyuv/issues/detail?id=548 for details.
  60. 'WARNING_CFLAGS': [
  61. '-Wno-sometimes-uninitialized',
  62. ],
  63. },
  64. 'cflags': [
  65. '-Wno-sometimes-uninitialized',
  66. ],
  67. }],
  68. [ 'OS != "ios" and libyuv_disable_jpeg != 1', {
  69. 'defines': [
  70. 'HAVE_JPEG',
  71. ],
  72. }],
  73. ['OS=="android"', {
  74. 'dependencies': [
  75. '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
  76. ],
  77. }],
  78. # TODO(YangZhang): These lines can be removed when high accuracy
  79. # YUV to RGB to Neon is ported.
  80. [ '(target_arch == "armv7" or target_arch == "armv7s" \
  81. or (target_arch == "arm" and arm_version >= 7) \
  82. or target_arch == "arm64") \
  83. and (arm_neon == 1 or arm_neon_optional == 1)', {
  84. 'defines': [
  85. 'LIBYUV_NEON'
  86. ],
  87. }],
  88. [ '(target_arch == "mipsel" or target_arch == "mips64el") \
  89. and (mips_msa == 1)', {
  90. 'defines': [
  91. 'LIBYUV_MSA'
  92. ],
  93. }],
  94. ], # conditions
  95. 'defines': [
  96. # Enable the following 3 macros to turn off assembly for specified CPU.
  97. # 'LIBYUV_DISABLE_X86',
  98. # 'LIBYUV_DISABLE_NEON',
  99. # 'LIBYUV_DISABLE_MIPS',
  100. # Enable the following macro to build libyuv as a shared library (dll).
  101. # 'LIBYUV_USING_SHARED_LIBRARY',
  102. ],
  103. },
  104. {
  105. 'target_name': 'compare',
  106. 'type': 'executable',
  107. 'dependencies': [
  108. 'libyuv.gyp:libyuv',
  109. ],
  110. 'sources': [
  111. # sources
  112. 'util/compare.cc',
  113. ],
  114. 'conditions': [
  115. ['OS=="linux"', {
  116. 'cflags': [
  117. '-fexceptions',
  118. ],
  119. }],
  120. ], # conditions
  121. },
  122. {
  123. 'target_name': 'convert',
  124. 'type': 'executable',
  125. 'dependencies': [
  126. 'libyuv.gyp:libyuv',
  127. ],
  128. 'sources': [
  129. # sources
  130. 'util/convert.cc',
  131. ],
  132. 'conditions': [
  133. ['OS=="linux"', {
  134. 'cflags': [
  135. '-fexceptions',
  136. ],
  137. }],
  138. ], # conditions
  139. },
  140. # TODO(fbarchard): Enable SSE2 and OpenMP for better performance.
  141. {
  142. 'target_name': 'psnr',
  143. 'type': 'executable',
  144. 'sources': [
  145. # sources
  146. 'util/psnr_main.cc',
  147. 'util/psnr.cc',
  148. 'util/ssim.cc',
  149. ],
  150. 'dependencies': [
  151. 'libyuv.gyp:libyuv',
  152. ],
  153. 'conditions': [
  154. [ 'OS != "ios" and libyuv_disable_jpeg != 1', {
  155. 'defines': [
  156. 'HAVE_JPEG',
  157. ],
  158. }],
  159. ], # conditions
  160. },
  161. {
  162. 'target_name': 'cpuid',
  163. 'type': 'executable',
  164. 'sources': [
  165. # sources
  166. 'util/cpuid.c',
  167. ],
  168. 'dependencies': [
  169. 'libyuv.gyp:libyuv',
  170. ],
  171. },
  172. ], # targets
  173. 'conditions': [
  174. ['OS=="android"', {
  175. 'targets': [
  176. {
  177. 'target_name': 'yuv_unittest_apk',
  178. 'type': 'none',
  179. 'variables': {
  180. 'test_suite_name': 'yuv_unittest',
  181. 'input_shlib_path': '<(SHARED_LIB_DIR)/(SHARED_LIB_PREFIX)libyuv_unittest<(SHARED_LIB_SUFFIX)',
  182. },
  183. 'includes': [
  184. 'build/apk_test.gypi',
  185. ],
  186. 'dependencies': [
  187. 'libyuv_unittest',
  188. ],
  189. },
  190. ],
  191. }],
  192. ],
  193. }
  194. # Local Variables:
  195. # tab-width:2
  196. # indent-tabs-mode:nil
  197. # End:
  198. # vim: set expandtab tabstop=2 shiftwidth=2: