Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / web / web.gyp
blob1fcd582c4cef55891ac1516294e8b8916164b529
2 # Copyright (C) 2011 Google Inc. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
6 # met:
8 #         * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 #         * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
13 # distribution.
14 #         * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32     'variables': {
33       'blink_web_output_dir': '<(SHARED_INTERMEDIATE_DIR)/blink/web',
34     },
35     'includes': [
36         '../bindings/bindings.gypi',
37         '../core/core.gypi',
38         '../build/features.gypi',
39         '../build/scripts/scripts.gypi',
40         '../build/win/precompile.gypi',
41         '../modules/modules.gypi',
42         '../platform/blink_platform.gypi',
43         '../wtf/wtf.gypi',
44         'web.gypi',
45     ],
46     'target_defaults': {
47         'variables': {
48             'clang_warning_flags': ['-Wglobal-constructors'],
49         },
50     },
51     'targets': [
52         {
53             'target_name': 'blink_web',
54             'type': '<(component)',
55             'variables': { 'enable_wexit_time_destructors': 1, },
56             'dependencies': [
57                 '../config.gyp:config',
58                 '../platform/blink_platform.gyp:blink_common',
59                 '../modules/modules.gyp:modules',
60                 '<(DEPTH)/skia/skia.gyp:skia',
61                 '<(angle_path)/src/angle.gyp:translator',
62                 '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
63                 '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
64                 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
65             ],
66             'export_dependent_settings': [
67                 '<(DEPTH)/skia/skia.gyp:skia',
68                 '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
69                 '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
70                 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
71             ],
72             'include_dirs': [
73                 '<(angle_path)/include',
74                 '<(DEPTH)/third_party/skia/include/utils',
75             ],
76             'defines': [
77                 'BLINK_IMPLEMENTATION=1',
78                 'INSIDE_BLINK',
79             ],
80             'sources': [
81                 '<@(web_files)',
82             ],
83             'conditions': [
84                 ['component=="shared_library"', {
85                     'dependencies': [
86                         '../platform/blink_platform_tests.gyp:blink_platform_test_support',
87                         '../wtf/wtf_tests.gyp:wtf_unittest_helpers',
88                         '<(DEPTH)/base/base.gyp:test_support_base',
89                         '<(DEPTH)/testing/gmock.gyp:gmock',
90                         '<(DEPTH)/testing/gtest.gyp:gtest',
91                         '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
92                         '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
93                         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
94                         '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
95                         '<(DEPTH)/third_party/modp_b64/modp_b64.gyp:modp_b64',
96                         '<(DEPTH)/third_party/ots/ots.gyp:ots',
97                         '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
98                         '<(DEPTH)/url/url.gyp:url_lib',
99                         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
100                         '<(libjpeg_gyp_path):libjpeg',
101                         # We must not add webkit_support here because of cyclic dependency.
102                     ],
103                     'export_dependent_settings': [
104                         '<(DEPTH)/url/url.gyp:url_lib',
105                         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
106                     ],
107                     'variables': {
108                       'clang_warning_flags_unset': [
109                         # FIXME: It would be nice to enable this in shared builds too,
110                         # but the test files have global constructors from the GTEST macro
111                         # and we pull in the test files into the blink_web target in the
112                         # shared build.
113                         '-Wglobal-constructors',
114                       ],
115                     },
116                     'sources': [
117                         # Compile Blink unittest files into blink_web.dll in component build mode
118                         '<@(bindings_unittest_files)',
119                         '<@(core_unittest_files)',
120                         '<@(modules_unittest_files)',
121                         '<@(platform_unittest_support_files)',
122                         # FIXME: the next line should not be needed. We prefer to run these unit tests outside blink_web.dll.
123                         '<@(platform_web_unittest_files)',
124                         '<@(web_unittest_files)',
125                         'WebTestingSupport.cpp',
126                     ],
127                     'conditions': [
128                         ['use_openssl==0 and (OS=="win" or OS=="mac")', {
129                             'dependencies': [
130                                 '<(DEPTH)/third_party/nss/nss.gyp:*',
131                             ],
132                         }],
133                         ['link_core_modules_separately==1', {
134                             'dependencies': [
135                                 '../core/core.gyp:webcore_shared',
136                                 '../core/core.gyp:webcore_testing',
137                                 '../modules/modules.gyp:modules_testing',
138                                 '../platform/blink_platform.gyp:blink_common',
139                                 '../platform/blink_platform.gyp:blink_platform',
140                                 '../wtf/wtf.gyp:wtf',
141                             ],
142                         }, {
143                             'dependencies': [
144                                 '../core/core.gyp:webcore',
145                                 '../core/core.gyp:webcore_generated',
146                                 '../core/core.gyp:webcore_testing',
147                                 '../modules/modules.gyp:modules_testing',
148                                 '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
149                                 '<(DEPTH)/third_party/libxslt/libxslt.gyp:libxslt',
150                              ],
151                         }]
152                     ],
153                     'msvs_settings': {
154                       'VCLinkerTool': {
155                         'conditions': [
156                           ['incremental_chrome_dll==1', {
157                             'UseLibraryDependencyInputs': "true",
158                           }],
159                         ],
160                       },
161                     },
162                 }, {
163                      # component=="static_library"
164                      'dependencies': [
165                         '../core/core.gyp:webcore',
166                      ],
167                 }],
168                 ['OS == "linux"', {
169                     'dependencies': [
170                         '<(DEPTH)/build/linux/system.gyp:fontconfig',
171                     ],
172                 }, {
173                     'sources/': [
174                         ['exclude', 'linux/'],
175                     ],
176                 }],
177                 ['use_x11 == 1', {
178                     'dependencies': [
179                         '<(DEPTH)/build/linux/system.gyp:x11',
180                     ],
181                 }, {
182                     'sources/': [
183                         ['exclude', 'x11/'],
184                     ]
185                 }],
186                 ['OS=="mac"', {
187                     'link_settings': {
188                         'libraries': [
189                             '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
190                             '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
191                         ],
192                     },
193                 }, { # else: OS!="mac"
194                     'sources/': [
195                         ['exclude', 'mac/WebScrollbarTheme.cpp$'],
196                     ],
197                 }],
198                 ['use_default_render_theme==0', {
199                     'sources/': [
200                         ['exclude', 'default/WebRenderTheme.cpp'],
201                     ],
202                 }],
203             ],
204             'direct_dependent_settings': {
205                 'include_dirs': [
206                     '../../',
207                 ],
208             },
209             'target_conditions': [
210                 ['OS=="android"', {
211                     'sources/': [
212                         ['include', '^linux/WebFontRendering\\.cpp$'],
213                     ],
214                 }],
215             ],
216         },
217         {
218             # GN version: //third_party/WebKit/Source/web:test_support
219             'target_name': 'blink_web_test_support',
220             'conditions': [
221                 ['component=="shared_library"', {
222                     'type': 'none',
223                 }, {
224                     'type': 'static_library',
225                     'dependencies': [
226                         '../config.gyp:config',
227                         '../core/core.gyp:webcore_generated',
228                         '../core/core.gyp:webcore_testing',
229                         '../modules/modules.gyp:modules_testing',
230                         '../wtf/wtf.gyp:wtf',
231                         '<(DEPTH)/skia/skia.gyp:skia',
232                         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
233                     ],
234                     'include_dirs': [
235                         '../../',
236                         '<(SHARED_INTERMEDIATE_DIR)/blink',  # gen/blink
237                     ],
238                     'sources': [
239                         'WebTestingSupport.cpp',
240                     ],
241                 }],
242             ],
243         },
244         {
245            'target_name': 'image_decode_bench',
246            'type': 'executable',
247            'dependencies': [
248                '../config.gyp:config',
249                '../core/core.gyp:webcore',
250                '../platform/blink_platform.gyp:blink_common',
251                '../wtf/wtf.gyp:wtf',
252                'blink_web',
253                'blink_web_test_support',
254            ],
255            'defines': [
256                'BLINK_IMPLEMENTATION=1',
257            ],
258            'sources': [
259                'ImageDecodeBench.cpp',
260            ],
261         },
262     ], # targets
263     'conditions': [
264         ['gcc_version>=46', {
265             'target_defaults': {
266                 # Disable warnings about c++0x compatibility, as some names (such
267                 # as nullptr) conflict with upcoming c++0x types.
268                 'cflags_cc': ['-Wno-c++0x-compat'],
269             },
270         }],
271         ['OS=="mac"', {
272             'targets': [
273                 {
274                     'target_name': 'copy_mesa',
275                     'type': 'none',
276                     'dependencies': ['<(DEPTH)/third_party/mesa/mesa.gyp:osmesa'],
277                     'copies': [{
278                         'destination': '<(PRODUCT_DIR)/DumpRenderTree.app/Contents/MacOS/',
279                         'files': ['<(PRODUCT_DIR)/osmesa.so'],
280                     }],
281                 },
282             ],
283         }],
284     ], # conditions