[chromium] rename newwtf target back to wtf
[WebKit-https.git] / Tools / DumpRenderTree / DumpRenderTree.gyp / DumpRenderTree.gyp
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         'ahem_path': '../../DumpRenderTree/qt/fonts/AHEM____.TTF',
34         'tools_dir': '../..',
35         'source_dir': '../../../Source',
36         'conditions': [
37             # Location of the chromium src directory and target type is different
38             # if webkit is built inside chromium or as standalone project.
39             ['inside_chromium_build==0', {
40                 # Webkit is being built outside of the full chromium project.
41                 # e.g. via build-webkit --chromium
42                 'chromium_src_dir': '<(source_dir)/WebKit/chromium',
43             },{
44                 # WebKit is checked out in src/chromium/third_party/WebKit
45                 'chromium_src_dir': '<(tools_dir)/../../..',
46             }],
47         ],
48     },
49     'includes': [
50         '../DumpRenderTree.gypi',
51         '../../../Source/WebKit/chromium/features.gypi',
52     ],
53     'targets': [
54         {
55             'target_name': 'ImageDiff',
56             'type': 'executable',
57             'dependencies': [
58                 '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support_gfx',
59                 '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf',
60             ],
61             'include_dirs': [
62                 '<(source_dir)/JavaScriptCore',
63                 '<(DEPTH)',
64             ],
65             'sources': [
66                 '<(tools_dir)/DumpRenderTree/chromium/ImageDiff.cpp',
67             ],
68             'conditions': [
69                 ['OS=="android"', {
70                     # FIXME: Re-enable building ImageDiff after the dependencies
71                     # for host have been fixed, as this broke per the WTF move.
72                     'type': 'none',
73                 }],
74             ],
75         },
76         {
77             'target_name': 'DumpRenderTree',
78             'type': 'executable',
79             'mac_bundle': 1,
80             'dependencies': [
81                 '<(source_dir)/WebKit/chromium/WebKit.gyp:inspector_resources',
82                 '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit',
83                 '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf',
84                 '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
85                 '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
86                 '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
87                 '<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob',
88                 '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
89                 '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_user_agent',
90             ],
91             'include_dirs': [
92                 '<(chromium_src_dir)',
93                 '<(source_dir)/WebKit/chromium/public',
94                 '<(source_dir)/JavaScriptCore',
95                 '<(DEPTH)',
96             ],
97             'defines': [
98                 # Technically not a unit test but require functions available only to
99                 # unit tests.
100                 'UNIT_TEST',
101             ],
102             'sources': [
103                 '<@(drt_files)',
104             ],
105             'conditions': [
106                 ['OS=="win"', {
107                     'dependencies': [
108                         'LayoutTestHelper',
109                         '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libEGL',
110                         '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libGLESv2',
111                     ],
112
113                     'resource_include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/webkit'],
114                     'sources': [
115                         '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
116                         '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
117                         '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc',
118                         '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc',
119                     ],
120                     'conditions': [
121                         ['inside_chromium_build==1', {
122                             'configurations': {
123                                 'Debug_Base': {
124                                     'msvs_settings': {
125                                         'VCLinkerTool': {
126                                             'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
127                                         },
128                                     },
129                                 },
130                             },
131                         }],
132                     ],
133                     'copies': [{
134                         'destination': '<(PRODUCT_DIR)',
135                         'files': ['<(ahem_path)'],
136                     }],
137                 },{ # OS!="win"
138                     'sources/': [
139                         ['exclude', 'Win\\.cpp$'],
140                     ],
141                     'actions': [
142                         {
143                             'action_name': 'repack_locale',
144                             'variables': {
145                                 'repack_path': '<(chromium_src_dir)/tools/grit/grit/format/repack.py',
146                                 'pak_inputs': [
147                                     '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
148                                     '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.pak',
149                                     '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak',
150                                     '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
151                                     '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak',
152                             ]},
153                             'inputs': [
154                                 '<(repack_path)',
155                                 '<@(pak_inputs)',
156                             ],
157                             'outputs': [
158                                 '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak',
159                             ],
160                             'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
161                             'process_outputs_as_mac_bundle_resources': 1,
162                         },
163                     ], # actions
164                 }],
165                 ['OS=="mac"', {
166                     'dependencies': [
167                         '<(source_dir)/WebKit/chromium/WebKit.gyp:copy_mesa',
168                         'LayoutTestHelper',
169                     ],
170                     'mac_bundle_resources': [
171                         '<(ahem_path)',
172                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf',
173                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf',
174                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher300.ttf',
175                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher400.ttf',
176                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher500.ttf',
177                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher600.ttf',
178                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher700.ttf',
179                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher800.ttf',
180                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf',
181                         '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
182                     ],
183                 },{ # OS!="mac"
184                     'sources/': [
185                         # .mm is already excluded by common.gypi
186                         ['exclude', 'Mac\\.cpp$'],
187                     ],
188                 }],
189                 ['use_x11 == 1', {
190                     'dependencies': [
191                         '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
192                     ],
193                     'copies': [{
194                         'destination': '<(PRODUCT_DIR)',
195                         'files': [
196                             '<(ahem_path)',
197                             '<(tools_dir)/DumpRenderTree/chromium/fonts.conf',
198                             '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak',
199                         ]
200                     }],
201                     'variables': {
202                         # FIXME: Enable warnings on other platforms.
203                         'chromium_code': 1,
204                     },
205                     'conditions': [
206                         ['linux_use_tcmalloc == 1', {
207                             'dependencies': [
208                                 '<(chromium_src_dir)/base/allocator/allocator.gyp:allocator',
209                             ],
210                         }],
211                     ],
212                 },{ # use_x11 != 1
213                     'sources/': [
214                         ['exclude', 'Linux\\.cpp$']
215                     ]
216                 }],
217                 ['toolkit_uses_gtk == 1', {
218                     'defines': [
219                         'WTF_USE_GTK=1',
220                     ],
221                     'dependencies': [
222                         '<(chromium_src_dir)/build/linux/system.gyp:gtk',
223                     ],
224                     'include_dirs': [
225                         '<(source_dir)/WebKit/chromium/public/gtk',
226                     ],
227                 },{ # toolkit_uses_gtk != 1
228                     'sources/': [
229                         ['exclude', 'Gtk\\.cpp$']
230                     ]
231                 }],
232                 ['OS=="android"', {
233                     'dependencies': [
234                         # FIXME: Re-enable building ImageDiff on Android.
235                         # https://bugs.webkit.org/show_bug.cgi?id=82039
236                         #'ImageDiff#host',
237                     ],
238                     'sources/': [
239                         ['include', 'chromium/TestShellLinux\\.cpp$'],
240                     ],
241                 },{ # OS!="android"
242                     'sources/': [
243                         ['exclude', '(Android)\\.cpp$']
244                     ],
245                     'dependencies': [
246                         'ImageDiff',
247                         'copy_TestNetscapePlugIn',
248                         '<(chromium_src_dir)/third_party/mesa/mesa.gyp:osmesa',
249                     ],
250                 }],
251                 ['inside_chromium_build==1 and component=="shared_library"', {
252                     'sources': [
253                         '<(source_dir)/WebKit/chromium/src/ChromiumCurrentTime.cpp',
254                         '<(source_dir)/WebKit/chromium/src/ChromiumThreading.cpp',
255                     ],
256                     'include_dirs': [
257                         '<(source_dir)/WebKit/chromium/public',
258                     ],
259                     'dependencies': [
260                         '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf',
261                     ],
262                 }],
263                 ['inside_chromium_build==0', {
264                     'dependencies': [
265                         '<(chromium_src_dir)/webkit/support/setup_third_party.gyp:third_party_headers',
266                     ]
267                 }],
268                 ['inside_chromium_build==0 or component!="shared_library"', {
269                     'dependencies': [
270                         '<(source_dir)/WebCore/WebCore.gyp/WebCore.gyp:webcore_test_support',
271                     ],
272                     'include_dirs': [
273                         # WARNING: Do not view this particular case as a precedent for
274                         # including WebCore headers in DumpRenderTree project.
275                         '<(source_dir)/WebCore/testing/v8', # for WebCoreTestSupport.h, needed to link in window.internals code.
276                     ],
277                     'sources': [
278                         '<(source_dir)/WebKit/chromium/src/WebTestingSupport.cpp',
279                         '<(source_dir)/WebKit/chromium/public/WebTestingSupport.h',
280                     ],
281                 }],
282             ],
283         },
284         {
285             'target_name': 'TestNetscapePlugIn',
286             'type': 'loadable_module',
287             'sources': [ '<@(test_plugin_files)' ],
288             'dependencies': [
289                 '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
290             ],
291             'include_dirs': [
292                 '<(chromium_src_dir)',
293                 '<(tools_dir)/DumpRenderTree/TestNetscapePlugIn',
294                 '<(tools_dir)/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders',
295             ],
296             'conditions': [
297                 ['OS=="mac"', {
298                     'mac_bundle': 1,
299                     'product_extension': 'plugin',
300                     'link_settings': {
301                         'libraries': [
302                             '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
303                             '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
304                             '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
305                         ]
306                     },
307                     'xcode_settings': {
308                         'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
309                         'INFOPLIST_FILE': '<(tools_dir)/DumpRenderTree/TestNetscapePlugIn/mac/Info.plist',
310                     },
311                 }],
312                 ['os_posix == 1 and OS != "mac"', {
313                     'cflags': [
314                         '-fvisibility=default',
315                     ],
316                 }],
317                 ['OS=="win"', {
318                     'defines': [
319                         # This seems like a hack, but this is what Safari Win does.
320                         'snprintf=_snprintf',
321                     ],
322                     'sources': [
323                         '<(tools_dir)/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.def',
324                         '<(tools_dir)/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.rc',
325                     ],
326                     # The .rc file requires that the name of the dll is npTestNetscapePlugin.dll.
327                     'product_name': 'npTestNetscapePlugin',
328                 }],
329             ],
330         },
331         {
332             'target_name': 'copy_TestNetscapePlugIn',
333             'type': 'none',
334             'dependencies': [
335                 'TestNetscapePlugIn',
336             ],
337             'conditions': [
338                 ['OS=="win"', {
339                     'copies': [{
340                         'destination': '<(PRODUCT_DIR)/plugins',
341                         'files': ['<(PRODUCT_DIR)/npTestNetscapePlugIn.dll'],
342                     }],
343                 }],
344                 ['OS=="mac"', {
345                     'dependencies': ['TestNetscapePlugIn'],
346                     'copies': [{
347                         'destination': '<(PRODUCT_DIR)/plugins/',
348                         'files': ['<(PRODUCT_DIR)/TestNetscapePlugIn.plugin/'],
349                     }],
350                 }],
351                 ['os_posix == 1 and OS != "mac"', {
352                     'copies': [{
353                         'destination': '<(PRODUCT_DIR)/plugins',
354                         'files': ['<(PRODUCT_DIR)/libTestNetscapePlugIn.so'],
355                     }],
356                 }],
357             ],
358         },
359     ], # targets
360     'conditions': [
361         ['OS=="win"', {
362             'targets': [{
363                 'target_name': 'LayoutTestHelper',
364                 'type': 'executable',
365                 'sources': ['<(tools_dir)/DumpRenderTree/chromium/LayoutTestHelperWin.cpp'],
366             }],
367         }],
368         ['OS=="mac"', {
369             'targets': [{
370                 'target_name': 'LayoutTestHelper',
371                 'type': 'executable',
372                 'sources': ['<(tools_dir)/DumpRenderTree/chromium/LayoutTestHelper.mm'],
373                 'link_settings': {
374                     'libraries': [
375                         '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
376                     ],
377                 },
378             }],
379         }],
380         ['os_posix==1 and OS!="mac" and OS!="android" and gcc_version==46', {
381             'target_defaults': {
382                 # Disable warnings about c++0x compatibility, as some names (such
383                 # as nullptr) conflict with upcoming c++0x types.
384                 'cflags_cc': ['-Wno-c++0x-compat'],
385             },
386         }],
387     ], # conditions
388 }