Put back the temportary synced notifier icon in settings.
[chromium-blink-merge.git] / skia / skia_library_opts.gyp
blob9b0b93ed4b4591b24a13f5d700629b4b6dc2ecf9
1 # Copyright 2013 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.
6 # This gyp file contains the platform-specific optimizations for Skia
8   'targets': [
9     # Due to an unfortunate intersection of lameness between gcc and gyp,
10     # we have to build the *_SSE2.cpp files in a separate target.  The
11     # gcc lameness is that, in order to compile SSE2 intrinsics code, it
12     # must be passed the -msse2 flag.  However, with this flag, it may
13     # emit SSE2 instructions even for scalar code, such as the CPUID
14     # test used to test for the presence of SSE2.  So that, and all other
15     # code must be compiled *without* -msse2.  The gyp lameness is that it
16     # does not allow file-specific CFLAGS, so we must create this extra
17     # target for those files to be compiled with -msse2.
18     #
19     # This is actually only a problem on 32-bit Linux (all Intel Macs have
20     # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit
21     # SSE2 from instrinsics, which generating plain ol' 386 for everything
22     # else).  However, to keep the .gyp file simple and avoid platform-specific
23     # build breakage, we do this on all platforms.
25     # For about the same reason, we need to compile the ARM opts files
26     # separately as well.
27     {
28       'target_name': 'skia_opts',
29       'type': 'static_library',
30       'includes': [
31         'skia_common.gypi',
32       ],
33       'include_dirs': [
34         '../third_party/skia/include/core',
35         '../third_party/skia/include/effects',
36         '../third_party/skia/src/core',
37         '../third_party/skia/src/opts',
38       ],
39       'conditions': [
40         [ 'os_posix == 1 and OS != "mac" and OS != "android" and \
41            target_arch != "arm" and target_arch != "mipsel"', {
42           'cflags': [
43             '-msse2',
44           ],
45         }],
46         [ 'target_arch != "arm" and target_arch != "mipsel"', {
47           'sources': [
48             '../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp',
49             '../third_party/skia/src/opts/SkBlitRect_opts_SSE2.cpp',
50             '../third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp',
51             '../third_party/skia/src/opts/SkUtils_opts_SSE2.cpp',
52             '../third_party/skia/src/opts/SkXfermode_opts_none.cpp',
53             '../third_party/skia/src/opts/SkBitmapFilter_opts_SSE2.cpp',
54             '../third_party/skia/src/opts/SkMorphology_opts_SSE2.cpp',
55             '../third_party/skia/src/opts/SkBlurImage_opts_SSE2.cpp',
56           ],
57           'dependencies': [
58             'skia_opts_ssse3',
59           ],
60         }],
61         [ 'target_arch == "arm"', {
62           'conditions': [
63             [ 'arm_version >= 7 and arm_neon == 1', {
64               'defines': [
65                 '__ARM_HAVE_NEON',
66               ],
67             }],
68             [ 'arm_version >= 7 and arm_neon_optional == 1', {
69               'defines': [
70                 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
71               ],
72             }],
73             [ 'arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
74               'cflags': [
75                 # The neon assembly contains conditional instructions which
76                 # aren't enclosed in an IT block. The assembler complains
77                 # without this option.
78                 # See #86592.
79                 '-Wa,-mimplicit-it=always',
80               ],
81               'dependencies': [
82                 'skia_opts_neon',
83               ]
84            }],
85           ],
86           # The assembly uses the frame pointer register (r7 in Thumb/r11 in
87           # ARM), the compiler doesn't like that. Explicitly remove the
88           # -fno-omit-frame-pointer flag for Android, as that gets added to all
89           # targets via common.gypi.
90           'cflags!': [
91             '-fno-omit-frame-pointer',
92             '-marm',
93             '-mapcs-frame',
94           ],
95           'cflags': [
96             '-fomit-frame-pointer',
97           ],
98           'sources': [
99             '../third_party/skia/src/opts/SkBitmapProcState_opts_arm.cpp',
100           ],
101         }],
102         [ 'target_arch == "arm" and (arm_version < 7 or (arm_neon == 0 and arm_neon_optional == 1))', {
103           'sources': [
104             '../third_party/skia/src/opts/memset.arm.S',
105           ],
106         }],
107         [ 'target_arch == "arm" and arm_version < 6', {
108           'sources': [
109             '../third_party/skia/src/opts/SkBlitMask_opts_none.cpp',
110             '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
111             '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
112             '../third_party/skia/src/opts/SkXfermode_opts_none.cpp',
113             '../third_party/skia/src/opts/SkMorphology_opts_none.cpp',
114             '../third_party/skia/src/opts/SkBlurImage_opts_none.cpp',
115           ],
116         }],
117         [ 'target_arch == "arm" and arm_version >= 6', {
118           'sources': [
119             '../third_party/skia/src/opts/SkBlitMask_opts_arm.cpp',
120             '../third_party/skia/src/opts/SkBlitRow_opts_arm.cpp',
121             '../third_party/skia/src/opts/SkBlitRow_opts_arm.h',
122             '../third_party/skia/src/opts/opts_check_arm.cpp',
123             '../third_party/skia/src/opts/SkXfermode_opts_none.cpp',
124           ],
125         }],
126         [ 'target_arch == "mipsel"',{
127           'cflags': [
128             '-fomit-frame-pointer',
129           ],
130           'sources': [
131             '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
132             '../third_party/skia/src/opts/SkBlitMask_opts_none.cpp',
133             '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
134             '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
135             '../third_party/skia/src/opts/SkXfermode_opts_none.cpp',
136             '../third_party/skia/src/opts/SkMorphology_opts_none.cpp',
137             '../third_party/skia/src/opts/SkBlurImage_opts_none.cpp',
138           ],
139         }],
140       ],
141     },
142     # For the same lame reasons as what is done for skia_opts, we have to
143     # create another target specifically for SSSE3 code as we would not want
144     # to compile the SSE2 code with -mssse3 which would potentially allow
145     # gcc to generate SSSE3 code.
146     {
147       'target_name': 'skia_opts_ssse3',
148       'type': 'static_library',
149       'includes': [
150         'skia_common.gypi',
151       ],
152       'include_dirs': [
153         '../third_party/skia/include/core',
154         '../third_party/skia/include/effects',
155         '../third_party/skia/src/core',
156       ],
157       'conditions': [
158         [ 'OS in ["linux", "freebsd", "openbsd", "solaris", "android"]', {
159           'cflags': [
160             '-mssse3',
161           ],
162         }],
163         [ 'OS == "mac"', {
164           'xcode_settings': {
165             'GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS': 'YES',
166           },
167         }],
168         [ 'OS == "win"', {
169           'include_dirs': [
170             'config/win',
171           ],
172           'direct_dependent_settings': {
173             'include_dirs': [
174               'config/win',
175             ],
176           },
177         }],
178         [ 'target_arch != "arm" and target_arch != "mipsel"', {
179           'sources': [
180             '../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp',
181           ],
182         }],
183       ],
184     },
185     {
186       'target_name': 'skia_opts_none',
187       'type': 'static_library',
188       'includes': [
189         'skia_common.gypi',
190       ],
191       'include_dirs': [
192         '../third_party/skia/include/core',
193         '../third_party/skia/include/effects',
194         '../third_party/skia/src/core',
195       ],
196       'sources': [
197         '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
198         '../third_party/skia/src/opts/SkBlitMask_opts_none.cpp',
199         '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
200         '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
201         '../third_party/skia/src/opts/SkXfermode_opts_none.cpp',
202         '../third_party/skia/src/opts/SkMorphology_opts_none.cpp',
203         '../third_party/skia/src/opts/SkBlurImage_opts_none.cpp',
204       ],
205     },
206   ],
207   'conditions': [
208     # NEON code must be compiled with -mfpu=neon which also affects scalar
209     # code. To support dynamic NEON code paths, we need to build all
210     # NEON-specific sources in a separate static library. The situation
211     # is very similar to the SSSE3 one.
212     ['target_arch == "arm" and (arm_neon == 1 or arm_neon_optional == 1)', {
213       'targets': [
214         {
215           'target_name': 'skia_opts_neon',
216           'type': 'static_library',
217           'includes': [
218             'skia_common.gypi',
219           ],
220           'include_dirs': [
221             '../third_party/skia/include/core',
222             '../third_party/skia/include/effects',
223             '../third_party/skia/src/core',
224             '../third_party/skia/src/opts',
225           ],
226           'cflags!': [
227             '-fno-omit-frame-pointer',
228             '-mfpu=vfp',  # remove them all, just in case.
229             '-mfpu=vfpv3',
230             '-mfpu=vfpv3-d16',
231           ],
232           'cflags': [
233             '-mfpu=neon',
234             '-fomit-frame-pointer',
235           ],
236           'ldflags': [
237             '-march=armv7-a',
238             '-Wl,--fix-cortex-a8',
239           ],
240           'sources': [
241             '../third_party/skia/src/opts/memset16_neon.S',
242             '../third_party/skia/src/opts/memset32_neon.S',
243             '../third_party/skia/src/opts/SkBitmapProcState_arm_neon.cpp',
244             '../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
245             '../third_party/skia/src/opts/SkBitmapProcState_matrix_clamp_neon.h',
246             '../third_party/skia/src/opts/SkBitmapProcState_matrix_repeat_neon.h',
247             '../third_party/skia/src/opts/SkBlitMask_opts_arm_neon.cpp',
248             '../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.cpp',
249             '../third_party/skia/src/opts/SkXfermode_opts_arm_neon.cpp',
250             '../third_party/skia/src/opts/SkBlurImage_opts_neon.cpp',
251             '../third_party/skia/src/opts/SkMorphology_opts_neon.cpp',
252           ],
253           'conditions': [
254             ['arm_neon == 1', {
255               'defines': [
256                 '__ARM_HAVE_NEON',
257               ],
258             }],
259             ['arm_neon_optional == 1', {
260               'defines': [
261                 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
262               ],
263             }],
264           ],
265         },
266       ],
267     }],
268   ],