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.
8 ['target_arch=="arm" or target_arch=="arm64"', {
9 'use_opus_fixed_point%': 1,
11 'use_opus_fixed_point%': 0,
13 ['target_arch=="arm"', {
14 'use_opus_arm_optimization%': 1,
16 'use_opus_arm_optimization%': 0,
18 ['target_arch=="arm" and (OS=="win" or OS=="android" or OS=="linux")', {
19 # Based on the conditions in celt/arm/armcpu.c:
20 # defined(_MSC_VER) || defined(__linux__).
28 'target_conditions': [
29 ['_type=="executable"', {
30 # All of the executable targets depend on 'opus'. Unfortunately the
31 # 'dependencies' block cannot be inherited via 'target_defaults'.
48 'cflags': [ '-Wno-absolute-value' ],
56 'target_name': 'opus',
57 'type': 'static_library',
67 'direct_dependent_settings': {
74 # Disable LTO due to ELF section name out of range
76 '../../build/android/disable_lto.gypi',
78 'sources': ['<@(opus_common_sources)'],
91 'msvs_disabled_warnings': [
92 4305, # Disable truncation warning in celt/pitch.c .
93 4334, # Disable 32-bit shift warning in src/opus_encoder.c .
98 'libraries': [ '-lm' ],
101 ['os_posix==1 and OS!="android"', {
102 # Suppress a warning given by opus_decoder.c that tells us
103 # optimizations are turned off.
105 '-Wno-#pragma-messages',
109 '-Wno-#pragma-messages',
113 ['os_posix==1 and (target_arch=="arm" or target_arch=="arm64")', {
117 ['use_opus_fixed_point==0', {
121 'sources': ['<@(opus_float_sources)'],
126 'direct_dependent_settings': {
134 'sources': ['<@(opus_fixed_sources)'],
136 ['use_opus_arm_optimization==1', {
139 'OPUS_ARM_INLINE_ASM',
140 'OPUS_ARM_INLINE_EDSP',
143 'opus_srcs_arm.gypi',
146 ['use_opus_rtcd==1', {
148 'OPUS_ARM_MAY_HAVE_EDSP',
149 'OPUS_ARM_MAY_HAVE_MEDIA',
150 'OPUS_ARM_MAY_HAVE_NEON',
154 'opus_srcs_rtcd.gypi',
164 'target_name': 'opus_compare',
165 'type': 'executable',
170 'src/src/opus_compare.c',
172 }, # target opus_compare
174 'target_name': 'opus_demo',
175 'type': 'executable',
180 'src/src/opus_demo.c',
182 }, # target opus_demo
184 'target_name': 'test_opus_api',
185 'type': 'executable',
190 'src/tests/test_opus_api.c',
192 }, # target test_opus_api
194 'target_name': 'test_opus_encode',
195 'type': 'executable',
200 'src/tests/test_opus_encode.c',
202 }, # target test_opus_encode
204 'target_name': 'test_opus_decode',
205 'type': 'executable',
210 'src/tests/test_opus_decode.c',
212 # test_opus_decode passes a null pointer to opus_decode() for an argument
213 # marked as requiring a non-null value by the nonnull function attribute,
214 # and expects opus_decode() to fail. Disable the -Wnonnull option to avoid
215 # a compilation error if -Werror is specified.
217 ['os_posix==1 and OS!="mac" and OS!="ios"', {
218 'cflags': ['-Wno-nonnull'],
220 ['OS=="mac" or OS=="ios"', {
222 'WARNING_CFLAGS': ['-Wno-nonnull'],
226 }, # target test_opus_decode
228 'target_name': 'test_opus_padding',
229 'type': 'executable',
234 'src/tests/test_opus_padding.c',
236 }, # target test_opus_padding