Exclude TrayIMETest.PerformActionOnDetailedView under valgrind, where it crashes.
[chromium-blink-merge.git] / ui / gfx / gfx.gyp
blob113e2fb48af34321b1c625a80b93bf708380ae14
1 # Copyright (c) 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   'variables': {
7     'chromium_code': 1,
8   },
9   'targets': [
10     {
11       'target_name': 'gfx_geometry',
12       'type': '<(component)',
13       'dependencies': [
14         '<(DEPTH)/base/base.gyp:base',
15       ],
16       'defines': [
17         'GFX_IMPLEMENTATION',
18       ],
19       'sources': [
20         'geometry/box_f.cc',
21         'geometry/box_f.h',
22         'geometry/cubic_bezier.cc',
23         'geometry/cubic_bezier.h',
24         'geometry/dip_util.cc',
25         'geometry/dip_util.h',
26         'geometry/insets.cc',
27         'geometry/insets.h',
28         'geometry/insets_base.h',
29         'geometry/insets_f.cc',
30         'geometry/insets_f.h',
31         'geometry/matrix3_f.cc',
32         'geometry/matrix3_f.h',
33         'geometry/point.cc',
34         'geometry/point.h',
35         'geometry/point3_f.cc',
36         'geometry/point3_f.h',
37         'geometry/point_conversions.cc',
38         'geometry/point_conversions.h',
39         'geometry/point_f.cc',
40         'geometry/point_f.h',
41         'geometry/quad_f.cc',
42         'geometry/quad_f.h',
43         'geometry/rect.cc',
44         'geometry/rect.h',
45         'geometry/rect_conversions.cc',
46         'geometry/rect_conversions.h',
47         'geometry/rect_f.cc',
48         'geometry/rect_f.h',
49         'geometry/safe_integer_conversions.h',
50         'geometry/scroll_offset.cc',
51         'geometry/scroll_offset.h',
52         'geometry/size.cc',
53         'geometry/size.h',
54         'geometry/size_conversions.cc',
55         'geometry/size_conversions.h',
56         'geometry/size_f.cc',
57         'geometry/size_f.h',
58         'geometry/vector2d.cc',
59         'geometry/vector2d.h',
60         'geometry/vector2d_conversions.cc',
61         'geometry/vector2d_conversions.h',
62         'geometry/vector2d_f.cc',
63         'geometry/vector2d_f.h',
64         'geometry/vector3d_f.cc',
65         'geometry/vector3d_f.h',
66       ],
67       'includes': [
68         '../../build/android/increase_size_for_speed.gypi',
69       ],
70     },
71     {
72       'target_name': 'gfx',
73       'type': '<(component)',
74       'dependencies': [
75         '<(DEPTH)/base/base.gyp:base',
76         '<(DEPTH)/base/base.gyp:base_i18n',
77         '<(DEPTH)/base/base.gyp:base_static',
78         '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
79         '<(DEPTH)/skia/skia.gyp:skia',
80         '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
81         '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
82         '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
83         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
84         '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
85         'gfx_geometry',
86       ],
87       # text_elider.h includes ICU headers.
88       'export_dependent_settings': [
89         '<(DEPTH)/skia/skia.gyp:skia',
90         '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
91         '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
92       ],
93       'defines': [
94         'GFX_IMPLEMENTATION',
95       ],
96       'include_dirs': [
97         '<(DEPTH)/third_party/icu/source/common',
98       ],
99       'sources': [
100         'android/device_display_info.cc',
101         'android/device_display_info.h',
102         'android/gfx_jni_registrar.cc',
103         'android/gfx_jni_registrar.h',
104         'android/java_bitmap.cc',
105         'android/java_bitmap.h',
106         'android/shared_device_display_info.cc',
107         'android/shared_device_display_info.h',
108         'android/view_configuration.cc',
109         'android/view_configuration.h',
110         'animation/animation.cc',
111         'animation/animation.h',
112         'animation/animation_container.cc',
113         'animation/animation_container.h',
114         'animation/animation_container_element.h',
115         'animation/animation_container_observer.h',
116         'animation/animation_delegate.h',
117         'animation/linear_animation.cc',
118         'animation/linear_animation.h',
119         'animation/multi_animation.cc',
120         'animation/multi_animation.h',
121         'animation/slide_animation.cc',
122         'animation/slide_animation.h',
123         'animation/throb_animation.cc',
124         'animation/throb_animation.h',
125         'animation/tween.cc',
126         'animation/tween.h',
127         'blit.cc',
128         'blit.h',
129         'break_list.h',
130         'canvas.cc',
131         'canvas.h',
132         'canvas_notimplemented.cc',
133         'canvas_paint_mac.h',
134         'canvas_paint_mac.mm',
135         'canvas_skia.cc',
136         'canvas_skia_paint.h',
137         'codec/jpeg_codec.cc',
138         'codec/jpeg_codec.h',
139         'codec/png_codec.cc',
140         'codec/png_codec.h',
141         'color_analysis.cc',
142         'color_analysis.h',
143         'color_profile.cc',
144         'color_profile.h',
145         'color_profile_mac.mm',
146         'color_profile_win.cc',
147         'color_utils.cc',
148         'color_utils.h',
149         'display.cc',
150         'display.h',
151         'display_change_notifier.cc',
152         'display_change_notifier.h',
153         'display_observer.cc',
154         'display_observer.h',
155         'favicon_size.cc',
156         'favicon_size.h',
157         'font.cc',
158         'font.h',
159         'font_fallback.h',
160         'font_fallback_linux.cc',
161         'font_fallback_mac.mm',
162         'font_fallback_win.cc',
163         'font_fallback_win.h',
164         'font_list.cc',
165         'font_list.h',
166         'font_list_impl.cc',
167         'font_list_impl.h',
168         'font_render_params.cc',
169         'font_render_params.h',
170         'font_render_params_android.cc',
171         'font_render_params_linux.cc',
172         'font_render_params_mac.cc',
173         'font_render_params_win.cc',
174         'gfx_export.h',
175         'gfx_paths.cc',
176         'gfx_paths.h',
177         'gpu_memory_buffer.cc',
178         'gpu_memory_buffer.h',
179         'harfbuzz_font_skia.cc',
180         'harfbuzz_font_skia.h',
181         'hud_font.cc',
182         'hud_font.h',
183         'image/canvas_image_source.cc',
184         'image/canvas_image_source.h',
185         'image/image.cc',
186         'image/image.h',
187         'image/image_family.cc',
188         'image/image_family.h',
189         'image/image_ios.mm',
190         'image/image_mac.mm',
191         'image/image_png_rep.cc',
192         'image/image_png_rep.h',
193         'image/image_skia.cc',
194         'image/image_skia.h',
195         'image/image_skia_operations.cc',
196         'image/image_skia_operations.h',
197         'image/image_skia_rep.cc',
198         'image/image_skia_rep.h',
199         'image/image_skia_source.h',
200         'image/image_skia_util_ios.h',
201         'image/image_skia_util_ios.mm',
202         'image/image_skia_util_mac.h',
203         'image/image_skia_util_mac.mm',
204         'image/image_util.cc',
205         'image/image_util.h',
206         'image/image_util_ios.mm',
207         'interpolated_transform.cc',
208         'interpolated_transform.h',
209         'ios/NSString+CrStringDrawing.h',
210         'ios/NSString+CrStringDrawing.mm',
211         'ios/uikit_util.h',
212         'ios/uikit_util.mm',
213         'linux_font_delegate.cc',
214         'linux_font_delegate.h',
215         'mac/coordinate_conversion.h',
216         'mac/coordinate_conversion.mm',
217         'mac/nswindow_frame_controls.h',
218         'mac/nswindow_frame_controls.mm',
219         'mac/scoped_cocoa_disable_screen_updates.h',
220         'native_widget_types.h',
221         'nine_image_painter.cc',
222         'nine_image_painter.h',
223         'overlay_transform.h',
224         'paint_throbber.cc',
225         'paint_throbber.h',
226         'path.cc',
227         'path.h',
228         'path_win.cc',
229         'path_win.h',
230         'path_x11.cc',
231         'path_x11.h',
232         'platform_font.h',
233         'platform_font_android.cc',
234         'platform_font_ios.h',
235         'platform_font_ios.mm',
236         'platform_font_linux.cc',
237         'platform_font_linux.h',
238         'platform_font_mac.h',
239         'platform_font_mac.mm',
240         'platform_font_win.cc',
241         'platform_font_win.h',
242         'range/range.cc',
243         'range/range.h',
244         'range/range_f.cc',
245         'range/range_f.h',
246         'range/range_mac.mm',
247         'range/range_win.cc',
248         'render_text.cc',
249         'render_text.h',
250         'render_text_harfbuzz.cc',
251         'render_text_harfbuzz.h',
252         'render_text_mac.cc',
253         'render_text_mac.h',
254         'scoped_canvas.h',
255         'scoped_cg_context_save_gstate_mac.h',
256         'scoped_ns_graphics_context_save_gstate_mac.h',
257         'scoped_ns_graphics_context_save_gstate_mac.mm',
258         'scoped_ui_graphics_push_context_ios.h',
259         'scoped_ui_graphics_push_context_ios.mm',
260         'screen.cc',
261         'screen.h',
262         'screen_android.cc',
263         'screen_aura.cc',
264         'screen_ios.mm',
265         'screen_mac.mm',
266         'screen_win.cc',
267         'screen_win.h',
268         'scrollbar_size.cc',
269         'scrollbar_size.h',
270         'selection_model.cc',
271         'selection_model.h',
272         'sequential_id_generator.cc',
273         'sequential_id_generator.h',
274         'shadow_value.cc',
275         'shadow_value.h',
276         'skbitmap_operations.cc',
277         'skbitmap_operations.h',
278         'skia_util.cc',
279         'skia_util.h',
280         'swap_result.h',
281         'switches.cc',
282         'switches.h',
283         'text_constants.h',
284         'text_elider.cc',
285         'text_elider.h',
286         'text_utils.cc',
287         'text_utils.h',
288         'text_utils_android.cc',
289         'text_utils_ios.mm',
290         'text_utils_skia.cc',
291         'transform.cc',
292         'transform.h',
293         'transform_util.cc',
294         'transform_util.h',
295         'ui_gfx_exports.cc',
296         'utf16_indexing.cc',
297         'utf16_indexing.h',
298         'vsync_provider.h',
299         'win/direct_write.cc',
300         'win/direct_write.h',
301         'win/dpi.cc',
302         'win/dpi.h',
303         'win/hwnd_util.cc',
304         'win/hwnd_util.h',
305         'win/metro_mode.cc',
306         'win/metro_mode.h',
307         'win/scoped_set_map_mode.h',
308         'win/singleton_hwnd.cc',
309         'win/singleton_hwnd.h',
310         'win/singleton_hwnd_observer.cc',
311         'win/singleton_hwnd_observer.h',
312         'win/window_impl.cc',
313         'win/window_impl.h',
314       ],
315       'includes': [
316         '../../build/android/increase_size_for_speed.gypi',
317       ],
318       'conditions': [
319         ['OS=="ios"', {
320           # Linkable dependents need to set the linker flag '-ObjC' in order to
321           # use the categories in this target (e.g. NSString+CrStringDrawing.h).
322           'link_settings': {
323             'xcode_settings': {'OTHER_LDFLAGS': ['-ObjC']},
324           },
325           'sources!': [
326             'codec/jpeg_codec.cc',
327           ],
328         }, {
329           'dependencies': [
330             '<(libjpeg_gyp_path):libjpeg',
331           ],
332         }],
333         # TODO(asvitkine): Switch all platforms to use canvas_skia.cc.
334         #                  http://crbug.com/105550
335         ['use_canvas_skia==1', {
336           'sources!': [
337             'canvas_notimplemented.cc',
338           ],
339         }, {  # use_canvas_skia!=1
340           'sources!': [
341             'canvas_skia.cc',
342           ],
343         }],
344         ['OS=="win"', {
345           'sources': [
346             'gdi_util.cc',
347             'gdi_util.h',
348             'icon_util.cc',
349             'icon_util.h',
350             'sys_color_change_listener.cc',
351             'sys_color_change_listener.h',
352           ],
353           # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int
354           # C4324 is structure was padded due to __declspec(align()), which is
355           # uninteresting.
356           'msvs_disabled_warnings': [ 4267, 4324 ],
357         }],
358         ['OS=="android"', {
359           'sources!': [
360             'animation/throb_animation.cc',
361             'selection_model.cc',
362           ],
363           'dependencies': [
364             'gfx_jni_headers',
365             '<(DEPTH)/base/base.gyp:base_java',
366           ],
367           'link_settings': {
368             'libraries': [
369               '-landroid',
370               '-ljnigraphics',
371             ],
372           },
373         }],
374         ['chromeos==1', {
375           # Chrome OS requires robust JPEG decoding for the login screen.
376           'sources': [
377             'chromeos/codec/jpeg_codec_robust_slow.cc',
378             'chromeos/codec/jpeg_codec_robust_slow.h',
379           ],
380           'dependencies': [
381             '<(libjpeg_ijg_gyp_path):libjpeg',
382           ],
383         }],
384         ['use_aura==0 and toolkit_views==0', {
385           'sources!': [
386             'nine_image_painter.cc',
387             'nine_image_painter.h',
388           ],
389         }],
390         ['OS=="android" and use_aura==0', {
391           'sources!': [
392             'path.cc',
393           ],
394         }],
395         ['OS=="android" and use_aura==1', {
396           'sources!': [
397             'screen_android.cc',
398           ],
399         }],
400         ['OS=="android" or OS=="ios"', {
401           'sources!': [
402             'harfbuzz_font_skia.cc',
403             'harfbuzz_font_skia.h',
404             'render_text.cc',
405             'render_text.h',
406             'render_text_harfbuzz.cc',
407             'render_text_harfbuzz.h',
408             'text_utils_skia.cc',
409           ],
410         }, {  # desktop platforms
411         }],
412         ['use_x11==1', {
413           'dependencies': [
414             '../../build/linux/system.gyp:x11',
415             'x/gfx_x11.gyp:gfx_x11',
416           ],
417         }],
418         ['use_cairo==1', {
419           'dependencies': [
420             '<(DEPTH)/build/linux/system.gyp:pangocairo',
421           ],
422         }],
423         ['desktop_linux==1 or chromeos==1', {
424           'dependencies': [
425             # font_render_params_linux.cc uses fontconfig
426             '<(DEPTH)/build/linux/system.gyp:fontconfig',
427           ],
428         }],
429       ],
430       'target_conditions': [
431         # Need 'target_conditions' to override default filename_rules to include
432         # the file on iOS.
433         ['OS == "ios"', {
434           'sources/': [
435             ['include', '^scoped_cg_context_save_gstate_mac\\.h$'],
436           ],
437         }],
438       ],
439     },
440     # Separate from gfx to limit the impact of the hard_dependency.
441     {
442       'target_name': 'gfx_vector_icons',
443       'type': '<(component)',
444       'dependencies': [
445         '<(DEPTH)/base/base.gyp:base',
446         '<(DEPTH)/skia/skia.gyp:skia',
447         'gfx',
448         'gfx_geometry',
449       ],
450       'defines': [
451         'GFX_IMPLEMENTATION',
452       ],
453       'sources': [
454         'paint_vector_icon.cc',
455         'paint_vector_icon.h',
456         # The 2 in this file name is intended to get around issues with
457         # clean-up of generated files: crbug.com/509811
458         # TODO(estade): change this back to vector_icons_public.h in a second
459         # pass.
460         'vector_icons_public2.h',
461       ],
462       'variables': {
463         'vector_icons_cc_file': '<(INTERMEDIATE_DIR)/ui/gfx/vector_icons.cc',
464         # The 2 in this file name is intended to get around issues with
465         # clean-up of generated files: crbug.com/509811
466         # TODO(estade): change this back to vector_icons.h in a second pass.
467         'vector_icons_h_file': '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/vector_icons2.h',
468       },
469       'include_dirs': [
470         '<(SHARED_INTERMEDIATE_DIR)',
471       ],
472       'actions': [
473         {
474           # GN version: //ui/gfx:aggregate_vector_icons
475           'action_name': 'aggregate_vector_icons',
476           'inputs': [
477             'vector_icons/',
478           ],
479           'outputs': [
480             '<(vector_icons_cc_file)',
481             '<(vector_icons_h_file)',
482           ],
483           'action': [ 'python',
484                       'vector_icons/aggregate_vector_icons.py',
485                       '--working_directory=vector_icons/',
486                       '--output_cc=<(vector_icons_cc_file)',
487                       '--output_h=<(vector_icons_h_file)',
488           ],
489           'message': 'Aggregating vector resources.',
490           'process_outputs_as_sources': 1,
491         },
492       ],
493       # Export a hard dependency because of generated header files.
494       'hard_dependency': 1,
495     },
496     {
497       'target_name': 'gfx_test_support',
498       'type': 'static_library',
499       'sources': [
500         'image/image_unittest_util.cc',
501         'image/image_unittest_util.h',
502         'image/image_unittest_util_ios.mm',
503         'image/image_unittest_util_mac.mm',
504         'test/fontconfig_util_linux.cc',
505         'test/fontconfig_util_linux.h',
506         'test/gfx_util.cc',
507         'test/gfx_util.h',
508         'test/test_screen.h',
509         'test/test_screen.cc',
510         'test/ui_cocoa_test_helper.h',
511         'test/ui_cocoa_test_helper.mm',
512       ],
513       'dependencies': [
514         '../../base/base.gyp:base',
515         '../../skia/skia.gyp:skia',
516         '../../testing/gtest.gyp:gtest',
517       ],
518       'conditions': [
519         ['OS == "mac"', {
520           'link_settings': {
521             'libraries': [
522               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
523             ],
524           },
525         }],
526         ['OS=="ios"', {
527           # The cocoa files don't apply to iOS.
528           'sources/': [
529             ['exclude', 'cocoa']
530           ],
531         }],
532         ['OS=="linux"', {
533           'dependencies': [
534             '../../build/linux/system.gyp:fontconfig',
535           ],
536         }],
537       ],
538     },
539   ],
540   'conditions': [
541     ['OS=="android"' , {
542      'targets': [
543        {
544          'target_name': 'gfx_jni_headers',
545          'type': 'none',
546          'sources': [
547            '../android/java/src/org/chromium/ui/gfx/BitmapHelper.java',
548            '../android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java',
549            '../android/java/src/org/chromium/ui/gfx/ViewConfigurationHelper.java',
550          ],
551          'variables': {
552            'jni_gen_package': 'ui/gfx',
553          },
554          'includes': [ '../../build/jni_generator.gypi' ],
555        },
556      ],
557     }],
558   ],