Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / libyuv / libyuv.gyp
1 # Copyright 2011 The LibYuv Project Authors. All rights reserved.
2 #
3 # Use of this source code is governed by a BSD-style license
4 # that can be found in the LICENSE file in the root of the source
5 # tree. An additional intellectual property rights grant can be found
6 # in the file PATENTS. All contributing project authors may
7 # be found in the AUTHORS file in the root of the source tree.
8
9 {
10   'includes': [
11     'libyuv.gypi',
12   ],
13   # Make sure that if we are being compiled to an xcodeproj, nothing tries to
14   # include a .pch.
15   'xcode_settings': {
16     'GCC_PREFIX_HEADER': '',
17     'GCC_PRECOMPILE_PREFIX_HEADER': 'NO',
18   },
19   'variables': {
20     'use_system_libjpeg%': 0,
21     'libyuv_disable_jpeg%': 0,
22     # Link-Time Optimizations.
23     'use_lto%': 0,
24     'build_neon': 0,
25     'conditions': [
26        ['(target_arch == "armv7" or target_arch == "armv7s" or \
27        (target_arch == "arm" and arm_version >= 7) or target_arch == "arm64")\
28        and (arm_neon == 1 or arm_neon_optional == 1)',
29        {
30          'build_neon': 1,
31        }],
32     ],
33   },
34   'conditions': [
35     ['build_neon != 0', {
36       'targets': [
37         # The NEON-specific components.
38         {
39           'target_name': 'libyuv_neon',
40           'type': 'static_library',
41           'standalone_static_library': 1,
42           # TODO(noahric): This should remove whatever mfpu is set, not
43           # just vfpv3-d16.
44           'cflags!': [
45             '-mfpu=vfp',
46             '-mfpu=vfpv3',
47             '-mfpu=vfpv3-d16',
48           ],
49           'conditions': [
50             # Disable LTO in libyuv_neon target due to gcc 4.9 compiler bug.
51             ['use_lto == 1', {
52               'cflags!': [
53                 '-flto',
54                 '-ffat-lto-objects',
55               ],
56             }],
57             # arm64 does not need -mfpu=neon option as neon is not optional
58             ['target_arch != "arm64"', {
59               'cflags': [
60                 '-mfpu=neon',
61               ],
62             }],
63           ],
64           'include_dirs': [
65             'include',
66             '.',
67           ],
68           'direct_dependent_settings': {
69             'include_dirs': [
70               'include',
71               '.',
72             ],
73           },
74           'sources': [
75             # sources.
76             'source/compare_neon.cc',
77             'source/compare_neon64.cc',
78             'source/rotate_neon.cc',
79             'source/rotate_neon64.cc',
80             'source/row_neon.cc',
81             'source/row_neon64.cc',
82             'source/scale_neon.cc',
83             'source/scale_neon64.cc',
84           ],
85         },
86       ],
87     }],
88   ],
89   'targets': [
90     {
91       'target_name': 'libyuv',
92       # Change type to 'shared_library' to build .so or .dll files.
93       'type': 'static_library',
94       # Allows libyuv.a redistributable library without external dependencies.
95       'standalone_static_library': 1,
96       'conditions': [
97         ['OS != "ios" and libyuv_disable_jpeg != 1', {
98           'defines': [
99             'HAVE_JPEG'
100           ],
101           'conditions': [
102             # Caveat system jpeg support may not support motion jpeg
103             [ 'use_system_libjpeg == 1', {
104               'dependencies': [
105                  '<(DEPTH)/third_party/libjpeg/libjpeg.gyp:libjpeg',
106               ],
107             }, {
108               'dependencies': [
109                  '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp:libjpeg',
110               ],
111             }],
112             [ 'use_system_libjpeg == 1', {
113               'link_settings': {
114                 'libraries': [
115                   '-ljpeg',
116                 ],
117               }
118             }],
119           ],
120         }],
121         ['build_neon != 0', {
122           'dependencies': [
123             'libyuv_neon',
124           ],
125         }],
126         # MemorySanitizer does not support assembly code yet.
127         # http://crbug.com/344505
128         [ 'msan == 1', {
129           'defines': [
130             'LIBYUV_DISABLE_X86',
131           ],
132         }],
133       ], #conditions
134       'defines': [
135         # Enable the following 3 macros to turn off assembly for specified CPU.
136         # 'LIBYUV_DISABLE_X86',
137         # 'LIBYUV_DISABLE_NEON',
138         # 'LIBYUV_DISABLE_MIPS',
139         # Enable the following macro to build libyuv as a shared library (dll).
140         # 'LIBYUV_USING_SHARED_LIBRARY',
141         # TODO(fbarchard): Make these into gyp defines.
142       ],
143       'include_dirs': [
144         'include',
145         '.',
146       ],
147       'direct_dependent_settings': {
148         'include_dirs': [
149           'include',
150           '.',
151         ],
152         'conditions': [
153           ['OS == "android" and target_arch == "arm64"', {
154             'ldflags': [
155               '-Wl,--dynamic-linker,/system/bin/linker64',
156             ],
157           }],
158           ['OS == "android" and target_arch != "arm64"', {
159             'ldflags': [
160               '-Wl,--dynamic-linker,/system/bin/linker',
161             ],
162           }],
163         ], #conditions
164       },
165       'sources': [
166         '<@(libyuv_sources)',
167       ],
168     },
169   ], # targets.
170 }
171
172 # Local Variables:
173 # tab-width:2
174 # indent-tabs-mode:nil
175 # End:
176 # vim: set expandtab tabstop=2 shiftwidth=2: