OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'variables': { | 6 'variables': { |
7 'conditions': [ | 7 'conditions': [ |
8 ['target_arch=="arm" or target_arch=="arm64"', { | 8 ['target_arch=="arm" or target_arch=="arm64"', { |
9 'use_opus_fixed_point%': 1, | 9 'use_opus_fixed_point%': 1, |
10 }, { | 10 }, { |
11 'use_opus_fixed_point%': 0, | 11 'use_opus_fixed_point%': 0, |
12 }], | 12 }], |
13 ['target_arch=="arm"', { | 13 ['target_arch=="arm"', { |
14 'use_opus_arm_optimization%': 1, | 14 'use_opus_arm_optimization%': 1, |
15 }, { | 15 }, { |
16 'use_opus_arm_optimization%': 0, | 16 'use_opus_arm_optimization%': 0, |
17 }], | 17 }], |
18 ['target_arch=="arm" and (OS=="win" or OS=="android" or OS=="linux")', { | 18 ['target_arch=="arm" and (OS=="win" or OS=="android" or OS=="linux")', { |
19 # Based on the conditions in celt/arm/armcpu.c: | 19 # Based on the conditions in celt/arm/armcpu.c: |
20 # defined(_MSC_VER) || defined(__linux__). | 20 # defined(_MSC_VER) || defined(__linux__). |
21 'use_opus_rtcd%': 1, | 21 'use_opus_rtcd%': 1, |
22 }, { | 22 }, { |
23 'use_opus_rtcd%': 0, | 23 'use_opus_rtcd%': 0, |
24 }], | 24 }], |
25 ], | 25 ], |
26 }, | 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 }, |
27 'targets': [ | 54 'targets': [ |
28 { | 55 { |
29 'target_name': 'opus', | 56 'target_name': 'opus', |
30 'type': 'static_library', | 57 'type': 'static_library', |
31 'defines': [ | 58 'defines': [ |
32 'OPUS_BUILD', | 59 'OPUS_BUILD', |
33 'OPUS_EXPORT=', | 60 'OPUS_EXPORT=', |
34 ], | 61 ], |
35 'include_dirs': [ | 62 'include_dirs': [ |
36 'src/celt', | 63 'src/celt', |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 ], | 154 ], |
128 }], | 155 }], |
129 ], | 156 ], |
130 }, # target opus | 157 }, # target opus |
131 { | 158 { |
132 'target_name': 'opus_compare', | 159 'target_name': 'opus_compare', |
133 'type': 'executable', | 160 'type': 'executable', |
134 'dependencies': [ | 161 'dependencies': [ |
135 'opus' | 162 'opus' |
136 ], | 163 ], |
137 'conditions': [ | |
138 ['OS == "win"', { | |
139 'defines': [ | |
140 'inline=__inline', | |
141 ], | |
142 }], | |
143 ['OS=="android"', { | |
144 'link_settings': { | |
145 'libraries': [ | |
146 '-llog', | |
147 ], | |
148 }, | |
149 }], | |
150 ['clang==1', { | |
151 'cflags': [ '-Wno-absolute-value' ], | |
152 }] | |
153 ], | |
154 'sources': [ | 164 'sources': [ |
155 'src/src/opus_compare.c', | 165 'src/src/opus_compare.c', |
156 ], | 166 ], |
157 'include_dirs': [ | |
158 'src/celt', | |
159 'src/silk', | |
160 ], | |
161 }, # target opus_compare | 167 }, # target opus_compare |
162 { | 168 { |
163 'target_name': 'opus_demo', | 169 'target_name': 'opus_demo', |
164 'type': 'executable', | 170 'type': 'executable', |
165 'dependencies': [ | 171 'dependencies': [ |
166 'opus' | 172 'opus' |
167 ], | 173 ], |
168 'conditions': [ | |
169 ['OS == "win"', { | |
170 'defines': [ | |
171 'inline=__inline', | |
172 ], | |
173 }], | |
174 ['OS=="android"', { | |
175 'link_settings': { | |
176 'libraries': [ | |
177 '-llog', | |
178 ], | |
179 }, | |
180 }], | |
181 ['clang==1', { | |
182 'cflags': [ '-Wno-absolute-value' ], | |
183 }] | |
184 ], | |
185 'sources': [ | 174 'sources': [ |
186 'src/src/opus_demo.c', | 175 'src/src/opus_demo.c', |
187 ], | 176 ], |
188 'include_dirs': [ | 177 }, # target opus_demo |
189 'src/celt', | 178 { |
190 'src/silk', | 179 'target_name': 'test_opus_api', |
| 180 'type': 'executable', |
| 181 'dependencies': [ |
| 182 'opus' |
191 ], | 183 ], |
192 }, # target opus_demo | 184 'sources': [ |
| 185 'src/tests/test_opus_api.c', |
| 186 ], |
| 187 }, # target test_opus_api |
| 188 { |
| 189 'target_name': 'test_opus_encode', |
| 190 'type': 'executable', |
| 191 'dependencies': [ |
| 192 'opus' |
| 193 ], |
| 194 'sources': [ |
| 195 'src/tests/test_opus_encode.c', |
| 196 ], |
| 197 }, # target test_opus_encode |
| 198 { |
| 199 'target_name': 'test_opus_decode', |
| 200 'type': 'executable', |
| 201 'dependencies': [ |
| 202 'opus' |
| 203 ], |
| 204 'sources': [ |
| 205 'src/tests/test_opus_decode.c', |
| 206 ], |
| 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. |
| 211 'conditions': [ |
| 212 ['os_posix==1 and OS!="mac" and OS!="ios"', { |
| 213 'cflags': ['-Wno-nonnull'], |
| 214 }], |
| 215 ['OS=="mac" or OS=="ios"', { |
| 216 'xcode_settings': { |
| 217 'WARNING_CFLAGS': ['-Wno-nonnull'], |
| 218 }, |
| 219 }], |
| 220 ], |
| 221 }, # target test_opus_decode |
| 222 { |
| 223 'target_name': 'test_opus_padding', |
| 224 'type': 'executable', |
| 225 'dependencies': [ |
| 226 'opus' |
| 227 ], |
| 228 'sources': [ |
| 229 'src/tests/test_opus_padding.c', |
| 230 ], |
| 231 }, # target test_opus_padding |
193 ] | 232 ] |
194 } | 233 } |
OLD | NEW |