| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 { | |
| 6 'variables': { | |
| 7 'conditions': [ | |
| 8 ['target_arch=="arm" or target_arch=="arm64"', { | |
| 9 'use_opus_fixed_point%': 1, | |
| 10 }, { | |
| 11 'use_opus_fixed_point%': 0, | |
| 12 }], | |
| 13 ['target_arch=="arm"', { | |
| 14 'use_opus_arm_optimization%': 1, | |
| 15 }, { | |
| 16 'use_opus_arm_optimization%': 0, | |
| 17 }], | |
| 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__). | |
| 21 'use_opus_rtcd%': 1, | |
| 22 }, { | |
| 23 'use_opus_rtcd%': 0, | |
| 24 }], | |
| 25 ], | |
| 26 }, | |
| 27 'target_defaults': { | |
| 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'. | |
| 32 'include_dirs': [ | |
| 33 'src/celt', | |
| 34 'src/silk', | |
| 35 ], | |
| 36 'conditions': [ | |
| 37 ['OS == "win"', { | |
| 38 'defines': [ | |
| 39 'inline=__inline', | |
| 40 ], | |
| 41 }], | |
| 42 ['OS=="android"', { | |
| 43 'libraries': [ | |
| 44 '-llog', | |
| 45 ], | |
| 46 }], | |
| 47 ['clang==1', { | |
| 48 'cflags': [ '-Wno-absolute-value' ], | |
| 49 }] | |
| 50 ], | |
| 51 }], | |
| 52 ], | |
| 53 }, | |
| 54 'targets': [ | |
| 55 { | |
| 56 'target_name': 'opus', | |
| 57 'type': 'static_library', | |
| 58 'defines': [ | |
| 59 'OPUS_BUILD', | |
| 60 'OPUS_EXPORT=', | |
| 61 ], | |
| 62 'include_dirs': [ | |
| 63 'src/celt', | |
| 64 'src/include', | |
| 65 'src/silk', | |
| 66 ], | |
| 67 'direct_dependent_settings': { | |
| 68 'include_dirs': [ | |
| 69 'src/include', | |
| 70 ], | |
| 71 }, | |
| 72 'includes': [ | |
| 73 'opus_srcs.gypi', | |
| 74 # Disable LTO due to ELF section name out of range | |
| 75 # crbug.com/422251 | |
| 76 '../../build/android/disable_gcc_lto.gypi', | |
| 77 ], | |
| 78 'sources': ['<@(opus_common_sources)'], | |
| 79 'conditions': [ | |
| 80 ['OS!="win"', { | |
| 81 'defines': [ | |
| 82 'HAVE_LRINT', | |
| 83 'HAVE_LRINTF', | |
| 84 'VAR_ARRAYS', | |
| 85 ], | |
| 86 }, { | |
| 87 'defines': [ | |
| 88 'USE_ALLOCA', | |
| 89 'inline=__inline', | |
| 90 ], | |
| 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 . | |
| 94 ], | |
| 95 }], | |
| 96 ['os_posix==1 and OS!="android"', { | |
| 97 # Suppress a warning given by opus_decoder.c that tells us | |
| 98 # optimizations are turned off. | |
| 99 'cflags': [ | |
| 100 '-Wno-#pragma-messages', | |
| 101 ], | |
| 102 'xcode_settings': { | |
| 103 'WARNING_CFLAGS': [ | |
| 104 '-Wno-#pragma-messages', | |
| 105 ], | |
| 106 }, | |
| 107 'link_settings': { | |
| 108 # This appears in the OS!="android" section because all Android | |
| 109 # targets already link libm (in common.gypi), and it's important | |
| 110 # that it appears after libc++ on the link command line. | |
| 111 # https://code.google.com/p/android-developer-preview/issues/detail?
id=3193 | |
| 112 'libraries': [ '-lm' ], | |
| 113 }, | |
| 114 }], | |
| 115 ['os_posix==1 and (target_arch=="arm" or target_arch=="arm64")', { | |
| 116 'cflags!': ['-Os'], | |
| 117 'cflags': ['-O3'], | |
| 118 }], | |
| 119 ['use_opus_fixed_point==0', { | |
| 120 'include_dirs': [ | |
| 121 'src/silk/float', | |
| 122 ], | |
| 123 'sources': ['<@(opus_float_sources)'], | |
| 124 }, { | |
| 125 'defines': [ | |
| 126 'FIXED_POINT', | |
| 127 ], | |
| 128 'direct_dependent_settings': { | |
| 129 'defines': [ | |
| 130 'OPUS_FIXED_POINT', | |
| 131 ], | |
| 132 }, | |
| 133 'include_dirs': [ | |
| 134 'src/silk/fixed', | |
| 135 ], | |
| 136 'sources': ['<@(opus_fixed_sources)'], | |
| 137 'conditions': [ | |
| 138 ['use_opus_arm_optimization==1', { | |
| 139 'defines': [ | |
| 140 'OPUS_ARM_ASM', | |
| 141 'OPUS_ARM_INLINE_ASM', | |
| 142 'OPUS_ARM_INLINE_EDSP', | |
| 143 ], | |
| 144 'includes': [ | |
| 145 'opus_srcs_arm.gypi', | |
| 146 ], | |
| 147 'conditions': [ | |
| 148 ['use_opus_rtcd==1', { | |
| 149 'defines': [ | |
| 150 'OPUS_ARM_MAY_HAVE_EDSP', | |
| 151 'OPUS_ARM_MAY_HAVE_MEDIA', | |
| 152 'OPUS_ARM_MAY_HAVE_NEON', | |
| 153 'OPUS_ARM_MAY_HAVE_NEON_INTR', | |
| 154 'OPUS_HAVE_RTCD', | |
| 155 ], | |
| 156 'include_dirs': [ | |
| 157 'src', | |
| 158 ], | |
| 159 'includes': [ | |
| 160 'opus_srcs_rtcd.gypi', | |
| 161 ], | |
| 162 'cflags!': [ '-mfpu=vfpv3-d16' ], | |
| 163 'cflags': [ '-mfpu=neon' ], | |
| 164 }], | |
| 165 ], | |
| 166 }], | |
| 167 ], | |
| 168 }], | |
| 169 ], | |
| 170 }, # target opus | |
| 171 { | |
| 172 'target_name': 'opus_compare', | |
| 173 'type': 'executable', | |
| 174 'dependencies': [ | |
| 175 'opus' | |
| 176 ], | |
| 177 'sources': [ | |
| 178 'src/src/opus_compare.c', | |
| 179 ], | |
| 180 }, # target opus_compare | |
| 181 { | |
| 182 'target_name': 'opus_demo', | |
| 183 'type': 'executable', | |
| 184 'dependencies': [ | |
| 185 'opus' | |
| 186 ], | |
| 187 'sources': [ | |
| 188 'src/src/opus_demo.c', | |
| 189 ], | |
| 190 }, # target opus_demo | |
| 191 { | |
| 192 'target_name': 'test_opus_api', | |
| 193 'type': 'executable', | |
| 194 'dependencies': [ | |
| 195 'opus' | |
| 196 ], | |
| 197 'sources': [ | |
| 198 'src/tests/test_opus_api.c', | |
| 199 ], | |
| 200 }, # target test_opus_api | |
| 201 { | |
| 202 'target_name': 'test_opus_encode', | |
| 203 'type': 'executable', | |
| 204 'dependencies': [ | |
| 205 'opus' | |
| 206 ], | |
| 207 'sources': [ | |
| 208 'src/tests/test_opus_encode.c', | |
| 209 ], | |
| 210 }, # target test_opus_encode | |
| 211 { | |
| 212 'target_name': 'test_opus_decode', | |
| 213 'type': 'executable', | |
| 214 'dependencies': [ | |
| 215 'opus' | |
| 216 ], | |
| 217 'sources': [ | |
| 218 'src/tests/test_opus_decode.c', | |
| 219 ], | |
| 220 # test_opus_decode passes a null pointer to opus_decode() for an argument | |
| 221 # marked as requiring a non-null value by the nonnull function attribute, | |
| 222 # and expects opus_decode() to fail. Disable the -Wnonnull option to avoid | |
| 223 # a compilation error if -Werror is specified. | |
| 224 'conditions': [ | |
| 225 ['os_posix==1 and OS!="mac" and OS!="ios"', { | |
| 226 'cflags': ['-Wno-nonnull'], | |
| 227 }], | |
| 228 ['OS=="mac" or OS=="ios"', { | |
| 229 'xcode_settings': { | |
| 230 'WARNING_CFLAGS': ['-Wno-nonnull'], | |
| 231 }, | |
| 232 }], | |
| 233 ], | |
| 234 }, # target test_opus_decode | |
| 235 { | |
| 236 'target_name': 'test_opus_padding', | |
| 237 'type': 'executable', | |
| 238 'dependencies': [ | |
| 239 'opus' | |
| 240 ], | |
| 241 'sources': [ | |
| 242 'src/tests/test_opus_padding.c', | |
| 243 ], | |
| 244 }, # target test_opus_padding | |
| 245 ] | |
| 246 } | |
| OLD | NEW |