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)'],
129 'sources': ['<@(opus_fixed_sources)'],
131 ['use_opus_arm_optimization==1', {
134 'OPUS_ARM_INLINE_ASM',
135 'OPUS_ARM_INLINE_EDSP',
138 'opus_srcs_arm.gypi',
141 ['use_opus_rtcd==1', {
143 'OPUS_ARM_MAY_HAVE_EDSP',
144 'OPUS_ARM_MAY_HAVE_MEDIA',
145 'OPUS_ARM_MAY_HAVE_NEON',
149 'opus_srcs_rtcd.gypi',
159 'target_name': 'opus_compare',
160 'type': 'executable',
165 'src/src/opus_compare.c',
167 }, # target opus_compare
169 'target_name': 'opus_demo',
170 'type': 'executable',
175 'src/src/opus_demo.c',
177 }, # target opus_demo
179 'target_name': 'test_opus_api',
180 'type': 'executable',
185 'src/tests/test_opus_api.c',
187 }, # target test_opus_api
189 'target_name': 'test_opus_encode',
190 'type': 'executable',
195 'src/tests/test_opus_encode.c',
197 }, # target test_opus_encode
199 'target_name': 'test_opus_decode',
200 'type': 'executable',
205 'src/tests/test_opus_decode.c',
207 # test_opus_decode passes a null pointer to opus_decode() for an argument
208 # marked as requiring a non-null value by the nonnull function attribute,
209 # and expects opus_decode() to fail. Disable the -Wnonnull option to avoid
210 # a compilation error if -Werror is specified.
212 ['os_posix==1 and OS!="mac" and OS!="ios"', {
213 'cflags': ['-Wno-nonnull'],
215 ['OS=="mac" or OS=="ios"', {
217 'WARNING_CFLAGS': ['-Wno-nonnull'],
221 }, # target test_opus_decode
223 'target_name': 'test_opus_padding',
224 'type': 'executable',
229 'src/tests/test_opus_padding.c',
231 }, # target test_opus_padding