Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / opus / opus.gyp
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       ['((OS=="android" or chromeos==1) and target_arch=="arm") or (OS=="ios" and target_arch=="armv7")', {
9         'use_opus_fixed_point%': 1,
10         'use_opus_arm_optimization%': 1,
11       }, {
12         'use_opus_fixed_point%': 0,
13         'use_opus_arm_optimization%': 0,
14       }],
15       ['(OS=="android" or chromeos==1) and target_arch=="arm"', {
16         'use_opus_rtcd%': 1,
17       }, {
18         'use_opus_rtcd%': 0,
19       }],
20     ],
21   },
22   'targets': [
23     {
24       'target_name': 'opus',
25       'type': 'static_library',
26       'defines': [
27         'OPUS_BUILD',
28         'OPUS_EXPORT=',
29       ],
30       'include_dirs': [
31         'src/celt',
32         'src/include',
33         'src/silk',
34       ],
35       'direct_dependent_settings': {
36         'include_dirs': [
37           'src/include',
38         ],
39       },
40       'includes': ['opus_srcs.gypi', ],
41       'conditions': [
42         ['OS!="win"', {
43           'defines': [
44             'HAVE_LRINT',
45             'HAVE_LRINTF',
46             'VAR_ARRAYS',
47           ],
48         }, {
49           'defines': [
50             'USE_ALLOCA',
51             'inline=__inline',
52           ],
53           'msvs_disabled_warnings': [
54             4305,  # Disable truncation warning in celt/pitch.c .
55             4334,  # Disable 32-bit shift warning in src/opus_encoder.c .
56           ],
57         }],
58         [ 'os_posix==1 and OS!="android"', {
59           # Suppress a warning given by opus_decoder.c that tells us
60           # optimizations are turned off.
61           'cflags': [
62             '-Wno-#pragma-messages',
63           ],
64           'xcode_settings': {
65             'WARNING_CFLAGS': [
66               '-Wno-#pragma-messages',
67             ],
68           },
69         }],
70         ['use_opus_fixed_point==0', {
71           'include_dirs': [
72             'src/silk/float',
73           ],
74           'sources/': [
75             ['exclude', '/fixed/[^/]*_FIX.(h|c)$'],
76           ],
77         }, {
78           'defines': [
79             'FIXED_POINT',
80           ],
81           'include_dirs': [
82             'src/silk/fixed',
83           ],
84           'sources/': [
85             ['exclude', '/float/[^/]*_FLP.(h|c)$'],
86           ],
87           'conditions': [
88             ['use_opus_arm_optimization==1', {
89               'defines': [
90                 'OPUS_ARM_ASM',
91                 'OPUS_ARM_INLINE_ASM',
92                 'OPUS_ARM_INLINE_EDSP',
93               ],
94               'includes': [
95                 'opus_srcs_arm.gypi',
96               ],
97               'conditions': [
98                 ['use_opus_rtcd==1', {
99                   'defines': [
100                     'OPUS_ARM_MAY_HAVE_EDSP',
101                     'OPUS_ARM_MAY_HAVE_MEDIA',
102                     'OPUS_ARM_MAY_HAVE_NEON',
103                     'OPUS_HAVE_RTCD',
104                   ],
105                   'includes': [
106                     'opus_srcs_rtcd.gypi',
107                   ],
108                 }],
109               ],
110             }],
111           ],
112         }],
113       ],
114     },  # target opus
115     {
116       'target_name': 'opus_demo',
117       'type': 'executable',
118       'dependencies': [
119         'opus'
120       ],
121       'conditions': [
122         ['OS == "win"', {
123           'defines': [
124             'inline=__inline',
125           ],
126         }],
127         ['OS=="android"', {
128           'link_settings': {
129             'libraries': [
130               '-llog',
131             ],
132           },
133         }]
134       ],
135       'sources': [
136         'src/src/opus_demo.c',
137       ],
138       'include_dirs': [
139         'src/celt',
140         'src/silk',
141       ],
142     },  # target opus_demo
143   ]
144 }