1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 'libvpx_build_vp9%': 1,
7 'libvpx_source%': 'source/libvpx',
8 # Disable LTO for neon targets
13 'asm_obj_extension': 'o',
16 'asm_obj_extension': 'obj',
20 'target_arch_full': 'generic',
23 ['(target_arch=="arm" or target_arch=="armv7") and arm_neon==1', {
24 'target_arch_full': 'arm-neon',
27 ['OS=="android" and ((target_arch=="arm" or target_arch=="armv7") and arm_neon==0)', {
28 'target_arch_full': 'arm-neon-cpu-detect',
30 'target_arch_full': '<(target_arch)',
34 ['target_arch=="arm64"', {
35 'target_arch_full': 'arm64',
40 ['os_posix == 1 and OS != "mac"', {
41 'OS_CATEGORY%': 'linux',
43 'OS_CATEGORY%': '<(OS)',
47 # Location of the intermediate output.
48 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx',
51 'target_conditions': [
52 ['<(libvpx_build_vp9)==0', {
53 'sources/': [ ['exclude', '(^|/)vp9/'], ],
58 ['OS=="win" and buildtype=="Official"', {
59 # Do not set to 'size', as it results in an error on win64.
63 'clang_warning_flags': [
64 # libvpx heavily relies on implicit enum casting.
66 # libvpx does `if ((a == b))` in some places.
67 '-Wno-parentheses-equality',
68 # libvpx has many static functions in header, which trigger this warning
69 '-Wno-unused-function',
71 'clang_warning_flags_unset': [
72 # libvpx does assert(!"foo"); in some places.
73 '-Wstring-conversion',
78 ['target_arch=="ia32"', {
79 'includes': ['libvpx_srcs_x86_intrinsics.gypi', ],
81 ['target_arch=="x64" and msan==0', {
82 'includes': ['libvpx_srcs_x86_64_intrinsics.gypi', ],
84 [ '(target_arch=="arm" or target_arch=="armv7") and arm_neon==0 and OS=="android"', {
85 # When building for targets which may not have NEON (but may!), include
86 # support for neon and hide it behind Android cpu-features.
87 'includes': ['libvpx_srcs_arm_neon_cpu_detect_intrinsics.gypi', ],
89 [ '(target_arch != "arm" and target_arch != "armv7") and \
90 (target_arch != "mipsel" and target_arch != "mips64el")', {
93 # This libvpx target contains both encoder and decoder.
94 # Encoder is configured to be realtime only.
95 'target_name': 'libvpx_new',
96 'type': 'static_library',
98 'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx',
99 'OS_CATEGORY%': '<(OS_CATEGORY)',
102 '-I', 'source/config/<(OS_CATEGORY)/<(target_arch_full)',
103 '-I', 'source/config',
104 '-I', '<(libvpx_source)',
106 # yasm only gets the flags we define. It doesn't inherit any of the
107 # really useful defines that come with a gcc invocation. In this
108 # case, we rely on __ANDROID__ to set 'rand' to 'lrand48'.
109 # Previously we used the builtin _rand but that's gone away.
119 '../yasm/yasm_compile.gypi'
122 'source/config/<(OS_CATEGORY)/<(target_arch_full)',
125 '<(libvpx_source)/vp8/common',
126 '<(libvpx_source)/vp8/decoder',
127 '<(libvpx_source)/vp8/encoder',
128 '<(shared_generated_dir)', # Provides vpx_rtcd.h.
130 'direct_dependent_settings': {
135 # VS2010 does not correctly incrementally link obj files generated
136 # from asm files. This flag disables UseLibraryDependencyInputs to
137 # avoid this problem.
138 'msvs_2010_disable_uldi_when_referenced': 1,
140 ['target_arch=="ia32"', {
142 'libvpx_srcs_x86.gypi',
145 'libvpx_intrinsics_mmx',
146 'libvpx_intrinsics_sse2',
147 # Currently no sse3 intrinsic functions
148 #'libvpx_intrinsics_sse3',
149 'libvpx_intrinsics_ssse3',
150 'libvpx_intrinsics_sse4_1',
151 # Currently no avx intrinsic functions
152 #'libvpx_intrinsics_avx',
153 'libvpx_intrinsics_avx2',
156 ['target_arch=="arm64"', {
157 'includes': [ 'libvpx_srcs_arm64.gypi', ],
159 ['target_arch=="x64"', {
162 'includes': [ 'libvpx_srcs_generic.gypi', ],
165 'libvpx_srcs_x86_64.gypi',
168 'libvpx_intrinsics_mmx',
169 'libvpx_intrinsics_sse2',
170 # Currently no sse3 intrinsic functions
171 #'libvpx_intrinsics_sse3',
172 'libvpx_intrinsics_ssse3',
173 'libvpx_intrinsics_sse4_1',
174 # Currently no avx intrinsic functions
175 #'libvpx_intrinsics_avx',
176 'libvpx_intrinsics_avx2',
186 # 'libvpx' target for mipsel and mips64el builds.
187 [ 'target_arch=="mipsel" or target_arch=="mips64el"', {
190 # This libvpx target contains both encoder and decoder.
191 # Encoder is configured to be realtime only.
192 'target_name': 'libvpx_new',
193 'type': 'static_library',
195 'shared_generated_dir':
196 '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx',
199 'libvpx_srcs_mips.gypi',
202 'source/config/<(OS_CATEGORY)/<(target_arch_full)',
205 '<(libvpx_source)/vp8/common',
206 '<(libvpx_source)/vp8/decoder',
207 '<(libvpx_source)/vp8/encoder',
209 'direct_dependent_settings': {
215 'source/config/<(OS_CATEGORY)/<(target_arch_full)/vpx_config.c',
221 # 'libvpx' target for ARM builds.
222 [ '(target_arch=="arm" or target_arch=="armv7") ', {
225 # This libvpx target contains both encoder and decoder.
226 # Encoder is configured to be realtime only.
227 'target_name': 'libvpx_new',
228 'type': 'static_library',
230 'includes': [ 'ads2gas.gypi', ],
234 '-I<!(pwd)/source/config/<(OS_CATEGORY)/<(target_arch_full)',
235 '-I<!(pwd)/source/config',
236 '-I<(shared_generated_dir)',
240 'source/config/<(OS_CATEGORY)/<(target_arch_full)',
244 'direct_dependent_settings': {
250 # Libvpx optimizations for ARMv6 or ARMv7 without NEON.
255 'libvpx_srcs_arm_neon_cpu_detect.gypi',
258 'libvpx_intrinsics_neon',
262 'libvpx_srcs_arm.gypi',
267 # Libvpx optimizations for ARMv7 with NEON.
270 'libvpx_srcs_arm_neon.gypi',
273 ['OS == "android"', {
275 '../../build/android/ndk.gyp:cpu_features',
281 # Breaks at least boolhuff_armv5te:token_high_bit_not_set_ev.
282 '-fstack-protector-all', # Implies -fstack-protector