blob: 27b330f65df972e773949667a28debe79f667b47 [file] [log] [blame]
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -08001# 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
Hangyu Kuangf047e7c2016-07-06 14:21:45 -07006# in the file PATENTS. All contributing project authors may
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -08007# be found in the AUTHORS file in the root of the source tree.
8
9{
Hangyu Kuangf047e7c2016-07-06 14:21:45 -070010 'variables': {
11 'libyuv_disable_jpeg%': 0,
12 },
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -080013 'targets': [
14 {
15 'target_name': 'libyuv_unittest',
Hangyu Kuangf047e7c2016-07-06 14:21:45 -070016 'type': '<(gtest_target_type)',
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -080017 'dependencies': [
18 'libyuv.gyp:libyuv',
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -080019 'testing/gtest.gyp:gtest',
Hangyu Kuangf047e7c2016-07-06 14:21:45 -070020 'third_party/gflags/gflags.gyp:gflags',
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -080021 ],
Hangyu Kuangf047e7c2016-07-06 14:21:45 -070022 'direct_dependent_settings': {
23 'defines': [
24 'GTEST_RELATIVE_PATH',
25 ],
26 },
27 'export_dependent_settings': [
28 '<(DEPTH)/testing/gtest.gyp:gtest',
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -080029 ],
30 'sources': [
31 # headers
32 'unit_test/unit_test.h',
33
34 # sources
Hangyu Kuangf047e7c2016-07-06 14:21:45 -070035 'unit_test/basictypes_test.cc',
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -080036 'unit_test/compare_test.cc',
Hangyu Kuangf047e7c2016-07-06 14:21:45 -070037 'unit_test/color_test.cc',
38 'unit_test/convert_test.cc',
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -080039 'unit_test/cpu_test.cc',
Hangyu Kuangf047e7c2016-07-06 14:21:45 -070040 'unit_test/math_test.cc',
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -080041 'unit_test/planar_test.cc',
42 'unit_test/rotate_argb_test.cc',
43 'unit_test/rotate_test.cc',
44 'unit_test/scale_argb_test.cc',
45 'unit_test/scale_test.cc',
46 'unit_test/unit_test.cc',
Hangyu Kuangf047e7c2016-07-06 14:21:45 -070047 'unit_test/video_common_test.cc',
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -080048 ],
49 'conditions': [
50 ['OS=="linux"', {
51 'cflags': [
52 '-fexceptions',
53 ],
54 }],
Hangyu Kuangf047e7c2016-07-06 14:21:45 -070055 [ 'OS == "ios" and target_subarch == 64', {
56 'defines': [
57 'LIBYUV_DISABLE_NEON'
58 ],
59 }],
60 [ 'OS == "ios"', {
61 'xcode_settings': {
62 'DEBUGGING_SYMBOLS': 'YES',
63 'DEBUG_INFORMATION_FORMAT' : 'dwarf-with-dsym',
64 # Work around compile issue with isosim.mm, see
65 # https://code.google.com/p/libyuv/issues/detail?id=548 for details.
66 'WARNING_CFLAGS': [
67 '-Wno-sometimes-uninitialized',
68 ],
69 },
70 'cflags': [
71 '-Wno-sometimes-uninitialized',
72 ],
73 }],
74 [ 'OS != "ios" and libyuv_disable_jpeg != 1', {
75 'defines': [
76 'HAVE_JPEG',
77 ],
78 }],
79 ['OS=="android"', {
80 'dependencies': [
81 '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
82 ],
83 }],
84 # TODO(YangZhang): These lines can be removed when high accuracy
85 # YUV to RGB to Neon is ported.
86 [ '(target_arch == "armv7" or target_arch == "armv7s" \
87 or (target_arch == "arm" and arm_version >= 7) \
88 or target_arch == "arm64") \
89 and (arm_neon == 1 or arm_neon_optional == 1)', {
90 'defines': [
91 'LIBYUV_NEON'
92 ],
93 }],
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -080094 ], # conditions
Hangyu Kuangf047e7c2016-07-06 14:21:45 -070095 '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 ],
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -0800103 },
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -0800104 {
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 },
Hangyu Kuangf047e7c2016-07-06 14:21:45 -0700122 {
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 target_subarch == 64', {
155 'defines': [
156 'LIBYUV_DISABLE_NEON'
157 ],
158 }],
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -0800159
Hangyu Kuangf047e7c2016-07-06 14:21:45 -0700160 [ 'OS != "ios" and libyuv_disable_jpeg != 1', {
161 'defines': [
162 'HAVE_JPEG',
163 ],
164 }],
165 ], # conditions
166 },
167
168 {
169 'target_name': 'cpuid',
170 'type': 'executable',
171 'sources': [
172 # sources
173 'util/cpuid.c',
174 ],
175 'dependencies': [
176 'libyuv.gyp:libyuv',
177 ],
178 },
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -0800179 ], # targets
Hangyu Kuangf047e7c2016-07-06 14:21:45 -0700180 'conditions': [
181 ['OS=="android"', {
182 'targets': [
183 {
184 # TODO(kjellander): Figure out what to change in build/apk_test.gypi
185 # to it can be used instead of the copied code below. Using it in its
186 # current version was not possible, since the target starts with 'lib',
187 # which somewhere confuses the variables.
188 'target_name': 'libyuv_unittest_apk',
189 'type': 'none',
190 'variables': {
191 # These are used to configure java_apk.gypi included below.
192 'test_type': 'gtest',
193 'apk_name': 'libyuv_unittest',
194 'test_suite_name': 'libyuv_unittest',
195 'intermediate_dir': '<(PRODUCT_DIR)/libyuv_unittest_apk',
196 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)libyuv_unittest<(SHARED_LIB_SUFFIX)',
197 'final_apk_path': '<(intermediate_dir)/libyuv_unittest-debug.apk',
198 'java_in_dir': '<(DEPTH)/testing/android/native_test/java',
199 'test_runner_path': '<(DEPTH)/util/android/test_runner.py',
200 'native_lib_target': 'libyuv_unittest',
201 'gyp_managed_install': 0,
202 },
203 'includes': [
204 'build/android/test_runner.gypi',
205 'build/java_apk.gypi',
206 ],
207 'dependencies': [
208 '<(DEPTH)/base/base.gyp:base_java',
209 # TODO(kjellander): Figure out why base_build_config_gen is needed
210 # here. It really shouldn't since it's a dependency of base_java
211 # above, but there's always 0 tests run if it's missing.
212 '<(DEPTH)/base/base.gyp:base_build_config_gen',
213 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
214 '<(DEPTH)/build/android/pylib/remote/device/dummy/dummy.gyp:remote_device_dummy_apk',
215 '<(DEPTH)/testing/android/appurify_support.gyp:appurify_support_java',
216 '<(DEPTH)/testing/android/on_device_instrumentation.gyp:reporter_java',
217 '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
218 'libyuv_unittest',
219 ],
220 },
221 ],
222 }],
223 ],
Hendrik Dahlkamp33cfdeb2013-01-23 18:27:37 -0800224}
225
226# Local Variables:
227# tab-width:2
228# indent-tabs-mode:nil
229# End:
230# vim: set expandtab tabstop=2 shiftwidth=2: