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