1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
|
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'use_system_opus%': 0,
},
'conditions' : [
['use_system_opus == 0', {
'variables': {
'conditions': [
['target_arch=="arm" or target_arch=="arm64"', {
'use_opus_fixed_point%': 1,
}, {
'use_opus_fixed_point%': 0,
}],
['target_arch=="arm"', {
'use_opus_arm_optimization%': 1,
}, {
'use_opus_arm_optimization%': 0,
}],
['target_arch=="arm" and (OS=="win" or OS=="android" or OS=="linux")', {
# Based on the conditions in celt/arm/armcpu.c:
# defined(_MSC_VER) || defined(__linux__).
'use_opus_rtcd%': 1,
}, {
'use_opus_rtcd%': 0,
}],
],
},
'target_defaults': {
'target_conditions': [
['_type=="executable"', {
# All of the executable targets depend on 'opus'. Unfortunately the
# 'dependencies' block cannot be inherited via 'target_defaults'.
'include_dirs': [
'src/celt',
'src/silk',
],
'conditions': [
['OS == "win"', {
'defines': [
'inline=__inline',
],
}],
['OS=="android"', {
'libraries': [
'-llog',
],
}],
['clang==1', {
'cflags': [ '-Wno-absolute-value' ],
}]
],
}],
],
},
'targets': [
{
'target_name': 'opus',
'type': 'static_library',
'defines': [
'OPUS_BUILD',
'OPUS_EXPORT=',
],
'include_dirs': [
'src/celt',
'src/include',
'src/silk',
],
'direct_dependent_settings': {
'include_dirs': [
'src/include',
],
},
'includes': [
'opus_srcs.gypi',
# Disable LTO due to ELF section name out of range
# crbug.com/422251
'../../build/android/disable_gcc_lto.gypi',
],
'sources': ['<@(opus_common_sources)'],
'conditions': [
['OS!="win"', {
'defines': [
'HAVE_LRINT',
'HAVE_LRINTF',
'VAR_ARRAYS',
],
}, {
'defines': [
'USE_ALLOCA',
'inline=__inline',
],
'msvs_disabled_warnings': [
4305, # Disable truncation warning in celt/pitch.c .
4334, # Disable 32-bit shift warning in src/opus_encoder.c .
],
}],
['os_posix==1 and OS!="android"', {
# Suppress a warning given by opus_decoder.c that tells us
# optimizations are turned off.
'cflags': [
'-Wno-#pragma-messages',
],
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wno-#pragma-messages',
],
},
'link_settings': {
# This appears in the OS!="android" section because all Android
# targets already link libm (in common.gypi), and it's important
# that it appears after libc++ on the link command line.
# https://code.google.com/p/android-developer-preview/issues/detail?id=3193
'libraries': [ '-lm' ],
},
}],
['os_posix==1 and (target_arch=="arm" or target_arch=="arm64")', {
'cflags!': ['-Os'],
'cflags': ['-O3'],
}],
['use_opus_fixed_point==0', {
'include_dirs': [
'src/silk/float',
],
'sources': ['<@(opus_float_sources)'],
}, {
'defines': [
'FIXED_POINT',
],
'direct_dependent_settings': {
'defines': [
'OPUS_FIXED_POINT',
],
},
'include_dirs': [
'src/silk/fixed',
],
'sources': ['<@(opus_fixed_sources)'],
'conditions': [
['use_opus_arm_optimization==1', {
'defines': [
'OPUS_ARM_ASM',
'OPUS_ARM_INLINE_ASM',
'OPUS_ARM_INLINE_EDSP',
],
'includes': [
'opus_srcs_arm.gypi',
],
'conditions': [
['use_opus_rtcd==1', {
'defines': [
'OPUS_ARM_MAY_HAVE_EDSP',
'OPUS_ARM_MAY_HAVE_MEDIA',
'OPUS_ARM_MAY_HAVE_NEON',
'OPUS_HAVE_RTCD',
],
'includes': [
'opus_srcs_rtcd.gypi',
],
}],
],
}],
],
}],
],
}, # target opus
{
'target_name': 'opus_compare',
'type': 'executable',
'dependencies': [
'opus'
],
'sources': [
'src/src/opus_compare.c',
],
}, # target opus_compare
{
'target_name': 'opus_demo',
'type': 'executable',
'dependencies': [
'opus'
],
'sources': [
'src/src/opus_demo.c',
],
}, # target opus_demo
{
'target_name': 'test_opus_api',
'type': 'executable',
'dependencies': [
'opus'
],
'sources': [
'src/tests/test_opus_api.c',
],
}, # target test_opus_api
{
'target_name': 'test_opus_encode',
'type': 'executable',
'dependencies': [
'opus'
],
'sources': [
'src/tests/test_opus_encode.c',
],
}, # target test_opus_encode
{
'target_name': 'test_opus_decode',
'type': 'executable',
'dependencies': [
'opus'
],
'sources': [
'src/tests/test_opus_decode.c',
],
# test_opus_decode passes a null pointer to opus_decode() for an argument
# marked as requiring a non-null value by the nonnull function attribute,
# and expects opus_decode() to fail. Disable the -Wnonnull option to avoid
# a compilation error if -Werror is specified.
'conditions': [
['os_posix==1 and OS!="mac" and OS!="ios"', {
'cflags': ['-Wno-nonnull'],
}],
['OS=="mac" or OS=="ios"', {
'xcode_settings': {
'WARNING_CFLAGS': ['-Wno-nonnull'],
},
}],
],
}, # target test_opus_decode
{
'target_name': 'test_opus_padding',
'type': 'executable',
'dependencies': [
'opus'
],
'sources': [
'src/tests/test_opus_padding.c',
],
}, # target test_opus_padding
]
}, # 'use_system_opus == 0'
{
'targets': [
{
'target_name': 'opus',
'type': 'none',
'direct_dependent_settings': {
'cflags': [
'<!@(<(pkg-config) --cflags opus)',
],
},
'variables': {
'headers_root_path': 'src/include',
'header_filenames': [
'opus_custom.h',
'opus_defines.h',
'opus_multistream.h',
'opus_types.h',
'opus.h',
],
},
'includes': [
'../../build/shim_headers.gypi',
],
'link_settings': {
'ldflags': [
'<!@(<(pkg-config) --libs-only-L --libs-only-other opus)',
],
'libraries': [
'<!@(<(pkg-config) --libs-only-l opus)',
],
},
},
],
}
]]
}
|