libyuv_test.gyp 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. },
  12. 'targets': [
  13. {
  14. 'target_name': 'libyuv_unittest',
  15. 'type': '<(gtest_target_type)',
  16. 'dependencies': [
  17. 'libyuv.gyp:libyuv',
  18. 'testing/gtest.gyp:gtest',
  19. 'third_party/gflags/gflags.gyp:gflags',
  20. ],
  21. 'direct_dependent_settings': {
  22. 'defines': [
  23. 'GTEST_RELATIVE_PATH',
  24. ],
  25. },
  26. 'export_dependent_settings': [
  27. '<(DEPTH)/testing/gtest.gyp:gtest',
  28. ],
  29. 'sources': [
  30. # headers
  31. 'unit_test/unit_test.h',
  32. # sources
  33. 'unit_test/basictypes_test.cc',
  34. 'unit_test/compare_test.cc',
  35. 'unit_test/color_test.cc',
  36. 'unit_test/convert_test.cc',
  37. 'unit_test/cpu_test.cc',
  38. 'unit_test/math_test.cc',
  39. 'unit_test/planar_test.cc',
  40. 'unit_test/rotate_argb_test.cc',
  41. 'unit_test/rotate_test.cc',
  42. 'unit_test/scale_argb_test.cc',
  43. 'unit_test/scale_test.cc',
  44. 'unit_test/unit_test.cc',
  45. 'unit_test/video_common_test.cc',
  46. ],
  47. 'conditions': [
  48. ['OS=="linux"', {
  49. 'cflags': [
  50. '-fexceptions',
  51. ],
  52. }],
  53. [ 'OS == "ios" and target_subarch == 64', {
  54. 'defines': [
  55. 'LIBYUV_DISABLE_NEON'
  56. ],
  57. }],
  58. [ 'OS == "ios"', {
  59. 'xcode_settings': {
  60. 'DEBUGGING_SYMBOLS': 'YES',
  61. 'DEBUG_INFORMATION_FORMAT' : 'dwarf-with-dsym',
  62. # Work around compile issue with isosim.mm, see
  63. # https://code.google.com/p/libyuv/issues/detail?id=548 for details.
  64. 'WARNING_CFLAGS': [
  65. '-Wno-sometimes-uninitialized',
  66. ],
  67. },
  68. 'cflags': [
  69. '-Wno-sometimes-uninitialized',
  70. ],
  71. }],
  72. [ 'OS != "ios" and libyuv_disable_jpeg != 1', {
  73. 'defines': [
  74. 'HAVE_JPEG',
  75. ],
  76. }],
  77. ['OS=="android"', {
  78. 'dependencies': [
  79. '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
  80. ],
  81. }],
  82. # TODO(YangZhang): These lines can be removed when high accuracy
  83. # YUV to RGB to Neon is ported.
  84. [ '(target_arch == "armv7" or target_arch == "armv7s" \
  85. or (target_arch == "arm" and arm_version >= 7) \
  86. or target_arch == "arm64") \
  87. and (arm_neon == 1 or arm_neon_optional == 1)', {
  88. 'defines': [
  89. 'LIBYUV_NEON'
  90. ],
  91. }],
  92. ], # conditions
  93. 'defines': [
  94. # Enable the following 3 macros to turn off assembly for specified CPU.
  95. # 'LIBYUV_DISABLE_X86',
  96. # 'LIBYUV_DISABLE_NEON',
  97. # 'LIBYUV_DISABLE_MIPS',
  98. # Enable the following macro to build libyuv as a shared library (dll).
  99. # 'LIBYUV_USING_SHARED_LIBRARY',
  100. ],
  101. },
  102. {
  103. 'target_name': 'compare',
  104. 'type': 'executable',
  105. 'dependencies': [
  106. 'libyuv.gyp:libyuv',
  107. ],
  108. 'sources': [
  109. # sources
  110. 'util/compare.cc',
  111. ],
  112. 'conditions': [
  113. ['OS=="linux"', {
  114. 'cflags': [
  115. '-fexceptions',
  116. ],
  117. }],
  118. ], # conditions
  119. },
  120. {
  121. 'target_name': 'convert',
  122. 'type': 'executable',
  123. 'dependencies': [
  124. 'libyuv.gyp:libyuv',
  125. ],
  126. 'sources': [
  127. # sources
  128. 'util/convert.cc',
  129. ],
  130. 'conditions': [
  131. ['OS=="linux"', {
  132. 'cflags': [
  133. '-fexceptions',
  134. ],
  135. }],
  136. ], # conditions
  137. },
  138. # TODO(fbarchard): Enable SSE2 and OpenMP for better performance.
  139. {
  140. 'target_name': 'psnr',
  141. 'type': 'executable',
  142. 'sources': [
  143. # sources
  144. 'util/psnr_main.cc',
  145. 'util/psnr.cc',
  146. 'util/ssim.cc',
  147. ],
  148. 'dependencies': [
  149. 'libyuv.gyp:libyuv',
  150. ],
  151. 'conditions': [
  152. [ 'OS == "ios" and target_subarch == 64', {
  153. 'defines': [
  154. 'LIBYUV_DISABLE_NEON'
  155. ],
  156. }],
  157. [ 'OS != "ios" and libyuv_disable_jpeg != 1', {
  158. 'defines': [
  159. 'HAVE_JPEG',
  160. ],
  161. }],
  162. ], # conditions
  163. },
  164. {
  165. 'target_name': 'cpuid',
  166. 'type': 'executable',
  167. 'sources': [
  168. # sources
  169. 'util/cpuid.c',
  170. ],
  171. 'dependencies': [
  172. 'libyuv.gyp:libyuv',
  173. ],
  174. },
  175. ], # targets
  176. 'conditions': [
  177. ['OS=="android"', {
  178. 'targets': [
  179. {
  180. # TODO(kjellander): Figure out what to change in build/apk_test.gypi
  181. # to it can be used instead of the copied code below. Using it in its
  182. # current version was not possible, since the target starts with 'lib',
  183. # which somewhere confuses the variables.
  184. 'target_name': 'libyuv_unittest_apk',
  185. 'type': 'none',
  186. 'variables': {
  187. # These are used to configure java_apk.gypi included below.
  188. 'test_type': 'gtest',
  189. 'apk_name': 'libyuv_unittest',
  190. 'test_suite_name': 'libyuv_unittest',
  191. 'intermediate_dir': '<(PRODUCT_DIR)/libyuv_unittest_apk',
  192. 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)libyuv_unittest<(SHARED_LIB_SUFFIX)',
  193. 'final_apk_path': '<(intermediate_dir)/libyuv_unittest-debug.apk',
  194. 'java_in_dir': '<(DEPTH)/testing/android/native_test/java',
  195. 'test_runner_path': '<(DEPTH)/util/android/test_runner.py',
  196. 'native_lib_target': 'libyuv_unittest',
  197. 'gyp_managed_install': 0,
  198. },
  199. 'includes': [
  200. 'build/android/test_runner.gypi',
  201. 'build/java_apk.gypi',
  202. ],
  203. 'dependencies': [
  204. '<(DEPTH)/base/base.gyp:base_java',
  205. # TODO(kjellander): Figure out why base_build_config_gen is needed
  206. # here. It really shouldn't since it's a dependency of base_java
  207. # above, but there's always 0 tests run if it's missing.
  208. '<(DEPTH)/base/base.gyp:base_build_config_gen',
  209. '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
  210. '<(DEPTH)/build/android/pylib/remote/device/dummy/dummy.gyp:remote_device_dummy_apk',
  211. '<(DEPTH)/testing/android/appurify_support.gyp:appurify_support_java',
  212. '<(DEPTH)/testing/android/on_device_instrumentation.gyp:reporter_java',
  213. '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
  214. 'libyuv_unittest',
  215. ],
  216. },
  217. ],
  218. }],
  219. ],
  220. }
  221. # Local Variables:
  222. # tab-width:2
  223. # indent-tabs-mode:nil
  224. # End: