1#
2# Copyright (C) 2011 Google Inc. All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met:
7#
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.
17#
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.
29#
30
31{
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                '../core/core.gyp:webcore',
60                '../modules/modules.gyp:modules',
61                '<(DEPTH)/skia/skia.gyp:skia',
62                '<(angle_path)/src/build_angle.gyp:translator',
63                '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
64                '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
65                '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
66            ],
67            'export_dependent_settings': [
68                '<(DEPTH)/skia/skia.gyp:skia',
69                '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
70                '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
71                '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
72            ],
73            'include_dirs': [
74                '<(angle_path)/include',
75                '<(DEPTH)/third_party/skia/include/utils',
76            ],
77            'defines': [
78                'BLINK_IMPLEMENTATION=1',
79                'INSIDE_BLINK',
80            ],
81            'sources': [
82                '<@(web_files)',
83            ],
84            'conditions': [
85                ['component=="shared_library"', {
86                    'dependencies': [
87                        '../core/core.gyp:webcore_generated',
88                        '../core/core.gyp:webcore_testing',
89                        '../modules/modules.gyp:modules_testing',
90                        '../wtf/wtf_tests.gyp:wtf_unittest_helpers',
91                        '<(DEPTH)/base/base.gyp:test_support_base',
92                        '<(DEPTH)/testing/gmock.gyp:gmock',
93                        '<(DEPTH)/testing/gtest.gyp:gtest',
94                        '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
95                        '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
96                        '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
97                        '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
98                        '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
99                        '<(DEPTH)/third_party/libxslt/libxslt.gyp:libxslt',
100                        '<(DEPTH)/third_party/modp_b64/modp_b64.gyp:modp_b64',
101                        '<(DEPTH)/third_party/ots/ots.gyp:ots',
102                        '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
103                        '<(DEPTH)/url/url.gyp:url_lib',
104                        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
105                        '<(libjpeg_gyp_path):libjpeg',
106                        # We must not add webkit_support here because of cyclic dependency.
107                    ],
108                    'export_dependent_settings': [
109                        '<(DEPTH)/url/url.gyp:url_lib',
110                        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
111                    ],
112                    'variables': {
113                      'clang_warning_flags_unset': [
114                        # FIXME: It would be nice to enable this in shared builds too,
115                        # but the test files have global constructors from the GTEST macro
116                        # and we pull in the test files into the blink_web target in the
117                        # shared build.
118                        '-Wglobal-constructors',
119                      ],
120                    },
121                    'sources': [
122                        # Compile Blink unittest files into blink_web.dll in component build mode
123                        '<@(bindings_unittest_files)',
124                        '<@(core_unittest_files)',
125                        '<@(modules_unittest_files)',
126                        # FIXME: the next line should not be needed. We prefer to run these unit tests outside blink_web.dll.
127                        '<@(platform_web_unittest_files)',
128                        '<@(web_unittest_files)',
129                        'WebTestingSupport.cpp',
130                    ],
131                    'conditions': [
132                        ['OS=="win" or OS=="mac"', {
133                            'dependencies': [
134                                '<(DEPTH)/third_party/nss/nss.gyp:*',
135                            ],
136                        }],
137                    ],
138                    'msvs_settings': {
139                      'VCLinkerTool': {
140                        'conditions': [
141                          ['incremental_chrome_dll==1', {
142                            'UseLibraryDependencyInputs': "true",
143                          }],
144                        ],
145                      },
146                    },
147                }],
148                ['OS == "linux"', {
149                    'dependencies': [
150                        '<(DEPTH)/build/linux/system.gyp:fontconfig',
151                    ],
152                }, {
153                    'sources/': [
154                        ['exclude', 'linux/'],
155                    ],
156                }],
157                ['use_x11 == 1', {
158                    'dependencies': [
159                        '<(DEPTH)/build/linux/system.gyp:x11',
160                    ],
161                }, {
162                    'sources/': [
163                        ['exclude', 'x11/'],
164                    ]
165                }],
166                ['OS!="android"', {
167                    'sources/': [
168                        ['exclude', 'WebInputEventFactoryAndroid.cpp$'],
169                    ],
170                }],
171                ['OS=="mac"', {
172                    'link_settings': {
173                        'libraries': [
174                            '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
175                            '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
176                        ],
177                    },
178                }, { # else: OS!="mac"
179                    'sources/': [
180                        ['exclude', 'WebInputEventFactoryMac.mm$'],
181                        ['exclude', 'mac/WebScrollbarTheme.cpp$'],
182                    ],
183                }],
184                ['OS!="win"', {
185                    'sources/': [
186                        ['exclude', 'WebInputEventFactoryWin.cpp$'],
187                    ],
188                }],
189                ['use_default_render_theme==0', {
190                    'sources/': [
191                        ['exclude', 'default/WebRenderTheme.cpp'],
192                    ],
193                }],
194            ],
195            'direct_dependent_settings': {
196                'include_dirs': [
197                    '../../',
198                ],
199            },
200            'target_conditions': [
201                ['OS=="android"', {
202                    'sources/': [
203                        ['include', '^linux/WebFontRendering\\.cpp$'],
204                    ],
205                }],
206            ],
207        },
208        {
209            # GN version: //third_party/WebKit/Source/web:test_support
210            'target_name': 'blink_web_test_support',
211            'conditions': [
212                ['component=="shared_library"', {
213                    'type': 'none',
214                }, {
215                    'type': 'static_library',
216                    'dependencies': [
217                        '../config.gyp:config',
218                        '../core/core.gyp:webcore_testing',
219                        '../modules/modules.gyp:modules_testing',
220                        '../wtf/wtf.gyp:wtf',
221                        '<(DEPTH)/skia/skia.gyp:skia',
222                    ],
223                    'include_dirs': [
224                        '../../',
225                    ],
226                    'sources': [
227                        'WebTestingSupport.cpp',
228                    ],
229                }],
230            ],
231        },
232    ], # targets
233    'conditions': [
234        ['gcc_version>=46', {
235            'target_defaults': {
236                # Disable warnings about c++0x compatibility, as some names (such
237                # as nullptr) conflict with upcoming c++0x types.
238                'cflags_cc': ['-Wno-c++0x-compat'],
239            },
240        }],
241        ['OS=="mac"', {
242            'targets': [
243                {
244                    'target_name': 'copy_mesa',
245                    'type': 'none',
246                    'dependencies': ['<(DEPTH)/third_party/mesa/mesa.gyp:osmesa'],
247                    'copies': [{
248                        'destination': '<(PRODUCT_DIR)/DumpRenderTree.app/Contents/MacOS/',
249                        'files': ['<(PRODUCT_DIR)/osmesa.so'],
250                    }],
251                },
252            ],
253        }],
254    ], # conditions
255}
256