Support WebRTC in Android build toolchain
[chromium-blink-merge.git] / skia / skia.gyp
blobd1a227557c6122c6c8a2e2b3d4ae06a1ba5f1465
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.
6   'conditions': [
7     # In component mode (shared_lib), we build all of skia as a single DLL.
8     # However, in the static mode, we need to build skia as multiple targets
9     # in order to support the use case where a platform (e.g. Android) may
10     # already have a copy of skia as a system library.
11     ['component=="static_library" and use_system_skia==0', {
12       'targets': [
13         {
14           'target_name': 'skia_library',
15           'type': 'static_library',
16           'includes': [
17             'skia_library.gypi',
18             'skia_common.gypi',
19           ],
20         },
21       ],
22     }],
23     ['component=="static_library" and use_system_skia==1', {
24       'targets': [
25         {
26           'target_name': 'skia_library',
27           'type': 'none',
28           'includes': ['skia_system.gypi'],
29         },
30       ],
31     }],
32     ['component=="static_library"', {
33       'targets': [
34         {
35           'target_name': 'skia',
36           'type': 'none',
37           'dependencies': [
38             'skia_library',
39             'skia_chrome',
40           ],
41           'export_dependent_settings': [
42             'skia_library',
43             'skia_chrome',
44           ],
45         },
46         {
47           'target_name': 'skia_chrome',
48           'type': 'static_library',
49           'includes': [
50             'skia_chrome.gypi',
51             'skia_common.gypi',
52           ],
53         },
54       ],
55     },
56     {  # component != static_library
57       'targets': [
58         {
59           'target_name': 'skia',
60           'type': 'shared_library',
61           'includes': [
62             'skia_library.gypi',
63             'skia_chrome.gypi',
64             'skia_common.gypi',
65           ],
66           'defines': [
67             'SKIA_DLL',
68             'GR_DLL=1',
69             'GR_IMPLEMENTATION=1',
70             'SKIA_IMPLEMENTATION=1',
71           ],
72           'direct_dependent_settings': {
73             'defines': [
74               'SKIA_DLL',
75               'GR_DLL=1',
76             ],
77           },
78         },
79         {
80           'target_name': 'skia_library',
81           'type': 'none',
82         },
83         {
84           'target_name': 'skia_chrome',
85           'type': 'none',
86         },
87       ],
88     }],
89   ],
90   
91   # targets that are not dependent upon the component type
92   'targets': [
93     {
94       'target_name': 'skia_chrome_opts',
95       'type': 'static_library',
96       'include_dirs': [
97         '..',
98         'config',
99         '../third_party/skia/include/config',
100         '../third_party/skia/include/core',
101       ],
102       'conditions': [
103         [ 'os_posix == 1 and OS != "mac" and OS != "android" and \
104             target_arch != "arm" and target_arch != "mipsel"', {
105           'cflags': [
106             '-msse2',
107           ],
108         }],
109         [ 'target_arch != "arm" and target_arch != "mipsel"', {
110           'sources': [
111             'ext/convolver_SSE2.cc',
112           ],
113         }],
114         [ 'target_arch == "mipsel"',{
115           'cflags': [
116             '-fomit-frame-pointer',
117           ],
118           'sources': [
119             'ext/convolver_mips_dspr2.cc',
120           ],
121         }],
122       ],
123     },
124     {
125       'target_name': 'image_operations_bench',
126       'type': 'executable',
127       'dependencies': [
128         '../base/base.gyp:base',
129         'skia',
130       ],
131       'include_dirs': [
132         '..',
133       ],
134       'sources': [
135         'ext/image_operations_bench.cc',
136       ],
137     },
138   ],