.: Add Tools/Tool.xcodeproj,
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2011 01:39:36 +0000 (01:39 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2011 01:39:36 +0000 (01:39 +0000)
Source/WebKit/chromium/WebKitUnitTests.xcodeproj,
Source/WebKit/chromium/All.xcodeproj to .gitignore

https://bugs.webkit.org/show_bug.cgi?id=73823

Reviewed by Tony Chang.

* .gitignore:

Source/WebKit/chromium: binaries in webkit.gyp should be split into a new file to break circular dependencies on webkit_support
https://bugs.webkit.org/show_bug.cgi?id=73382

Reviewed by Tony Chang.

XCode (and hence GYP) can't handle circular dependencies between
files (and projects). Accordingly, although the binaries in
WebKit.gyp depend on webkit_support and webkit_support depends
on webkit, we don't mention the latter dependency in the file.
To fix this, this change moves the binaries like DRT into a new
GYP file, and modifies gyp_webkit to build from that file
instead of WebKit.gyp.

* WebKit.gyp:
* All.gyp:
* WebKitUnitTests.gyp:
* gyp_webkit:

Tools: binaries in webkit.gyp should be split into a new file to break circular dependencies on webkit_support
https://bugs.webkit.org/show_bug.cgi?id=73382

Reviewed by Tony Chang.

XCode (and hence GYP) can't handle circular dependencies between
files (and projects). Accordingly, although the binaries in
WebKit.gyp depend on webkit_support and webkit_support depends
on webkit, we don't mention the latter dependency in the file.
To fix this, this change moves the binaries like DRT into a new
GYP file, and modifies gyp_webkit to build from that file
instead of WebKit.gyp.

* Tools.gyp: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102201 268f45cc-cd09-0410-ab3c-d52691b4dbfc

.gitignore
ChangeLog
Source/WebKit/chromium/All.gyp [new file with mode: 0644]
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gyp
Source/WebKit/chromium/WebKitUnitTests.gyp [new file with mode: 0644]
Source/WebKit/chromium/gyp_webkit
Tools/ChangeLog
Tools/Tools.gyp [new file with mode: 0644]

index ac8cf5c..2676d23 100644 (file)
@@ -51,7 +51,10 @@ Source/WebKit/chromium/*.mk
 Source/WebKit/chromium/*.ninja
 Source/WebKit/chromium/*.sln
 Source/WebKit/chromium/*.vcproj*
+Source/WebKit/chromium/All.xcodeproj
 Source/WebKit/chromium/WebKit.xcodeproj
+Source/WebKit/chromium/WebKitUnitTests.xcodeproj
+Tools/Tools.xcodeproj
 Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.xcodeproj
 
 # Ignore status files that manage Chromium dependencies.
index 80a6d7e..ce50b7f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-12-06  Dirk Pranke  <dpranke@chromium.org>
+
+        Add Tools/Tool.xcodeproj,
+        Source/WebKit/chromium/WebKitUnitTests.xcodeproj,
+        Source/WebKit/chromium/All.xcodeproj to .gitignore
+
+        https://bugs.webkit.org/show_bug.cgi?id=73823
+
+        Reviewed by Tony Chang.
+
+        * .gitignore:
+
 2011-12-06  Simon Hausmann  <simon.hausmann@nokia.com>
 
         [Qt] build-jsc script doesn't work
diff --git a/Source/WebKit/chromium/All.gyp b/Source/WebKit/chromium/All.gyp
new file mode 100644 (file)
index 0000000..a96accf
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2011 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#         * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#         * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#         * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+{
+    'includes': [
+        'features.gypi',
+    ],
+    'targets': [
+        {
+            # These two targets should be sufficient to cause everything
+            # else to build (incl. webkit); if they aren't, we have our
+            # dependencies wrong.
+            'target_name': 'all_webkit',
+            'type': 'none',
+            'dependencies': [
+                'WebKitUnitTests.gyp:webkit_unit_tests',
+                '../../../Tools/Tools.gyp:DumpRenderTree',
+            ],
+        }
+    ],
+}
index 718823d..dd4d7c1 100644 (file)
@@ -1,3 +1,23 @@
+2011-12-06  Dirk Pranke  <dpranke@chromium.org>
+
+        binaries in webkit.gyp should be split into a new file to break circular dependencies on webkit_support
+        https://bugs.webkit.org/show_bug.cgi?id=73382
+
+        Reviewed by Tony Chang.
+
+        XCode (and hence GYP) can't handle circular dependencies between
+        files (and projects). Accordingly, although the binaries in
+        WebKit.gyp depend on webkit_support and webkit_support depends
+        on webkit, we don't mention the latter dependency in the file.
+        To fix this, this change moves the binaries like DRT into a new
+        GYP file, and modifies gyp_webkit to build from that file
+        instead of WebKit.gyp.
+
+        * WebKit.gyp:
+        * All.gyp:
+        * WebKitUnitTests.gyp:
+        * gyp_webkit:
+
 2011-12-06  Adrienne Walker  <enne@google.com>
 
         [chromium] setNeedsCommit on non-composited host layers should trigger commit
index 7e0a262..3424a63 100644 (file)
@@ -31,8 +31,6 @@
 {
     'includes': [
         '../../WebCore/WebCore.gypi',
-        '../../../Tools/DumpRenderTree/DumpRenderTree.gypi',
-        '../../../Tools/TestWebKitAPI/TestWebKitAPI.gypi',
         'WebKit.gypi',
         'features.gypi',
     ],
                                      '--output', '<@(_outputs)'],
             }],
         },
-        {
-            'target_name': 'webkit_unit_tests',
-            'type': 'executable',
-            'msvs_guid': '7CEFE800-8403-418A-AD6A-2D52C6FC3EAD',
-            'dependencies': [
-                'webkit',
-                '../../WebCore/WebCore.gyp/WebCore.gyp:webcore',
-                '<(chromium_src_dir)/testing/gtest.gyp:gtest',
-                '<(chromium_src_dir)/testing/gmock.gyp:gmock',
-                '<(chromium_src_dir)/base/base.gyp:base',
-                '<(chromium_src_dir)/base/base.gyp:base_i18n',
-                '<(chromium_src_dir)/base/base.gyp:test_support_base',
-                '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
-                '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_user_agent',
-            ],
-            'sources': [
-                'tests/RunAllTests.cpp',
-            ],
-            'include_dirs': [
-                'public',
-                'src',
-            ],
-            'conditions': [
-                ['inside_chromium_build==1 and component=="shared_library"', {
-                    'defines': [
-                        'WEBKIT_DLL_UNITTEST',
-                    ],
-                }, {
-                    'sources': [
-                        '<@(webkit_unittest_files)',
-                    ],
-                    'conditions': [
-                        ['toolkit_uses_gtk == 1', {
-                            'include_dirs': [
-                                'public/gtk',
-                            ],
-                            'variables': {
-                              # FIXME: Enable warnings on other platforms.
-                              'chromium_code': 1,
-                            },
-                        }],
-                    ],
-                }],
-                ['inside_chromium_build==1 and OS=="win" and component!="shared_library"', {
-                    'configurations': {
-                        'Debug_Base': {
-                            'msvs_settings': {
-                                'VCLinkerTool': {
-                                    'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
-                                },
-                            },
-                        },
-                    },
-                }],
-            ],
-        },
-        {
-            'target_name': 'ImageDiff',
-            'type': 'executable',
-            'dependencies': [
-                '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support_gfx',
-            ],
-            'include_dirs': [
-                '../../JavaScriptCore',
-                '<(DEPTH)',
-            ],
-            'sources': [
-                '../../../Tools/DumpRenderTree/chromium/ImageDiff.cpp',
-            ],
-            'conditions': [
-                ['OS=="android"', {
-                    'toolsets': ['host'],
-                }],
-            ],
-        },
-        {
-            'target_name': 'DumpRenderTree',
-            'type': 'executable',
-            'mac_bundle': 1,
-            'dependencies': [
-                'inspector_resources',
-                'webkit',
-                '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf_config',
-                '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
-                '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
-                '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
-                '<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob',
-                '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
-                '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_user_agent',
-            ],
-            'include_dirs': [
-                '<(chromium_src_dir)',
-                'public',
-                '../../JavaScriptCore',
-                '../../JavaScriptCore/wtf', # wtf/text/*.h refers headers in wtf/ without wtf/.
-                '<(DEPTH)',
-            ],
-            'defines': [
-                # Technically not a unit test but require functions available only to
-                # unit tests.
-                'UNIT_TEST',
-            ],
-            'sources': [
-                '<@(drt_files)',
-            ],
-            'conditions': [
-                ['OS=="win"', {
-                    'dependencies': [
-                        'LayoutTestHelper',
-                        '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libEGL',
-                        '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libGLESv2',
-                    ],
-
-                    'resource_include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/webkit'],
-                    'sources': [
-                        '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
-                        '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
-                        '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc',
-                        '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc',
-                    ],
-                    'conditions': [
-                        ['inside_chromium_build==1', {
-                            'configurations': {
-                                'Debug_Base': {
-                                    'msvs_settings': {
-                                        'VCLinkerTool': {
-                                            'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
-                                        },
-                                    },
-                                },
-                            },
-                        }],
-                    ],
-                    'copies': [{
-                        'destination': '<(PRODUCT_DIR)',
-                        'files': ['<(ahem_path)'],
-                    }],
-                },{ # OS!="win"
-                    'sources/': [
-                        ['exclude', 'Win\\.cpp$'],
-                    ],
-                    'actions': [
-                        {
-                            'action_name': 'repack_locale',
-                            'variables': {
-                                'repack_path': '<(chromium_src_dir)/tools/grit/grit/format/repack.py',
-                                'pak_inputs': [
-                                    '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
-                                    '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.pak',
-                                    '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak',
-                                    '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
-                                    '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak',
-                            ]},
-                            'inputs': [
-                                '<(repack_path)',
-                                '<@(pak_inputs)',
-                            ],
-                            'outputs': [
-                                '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak',
-                            ],
-                            'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
-                            'process_outputs_as_mac_bundle_resources': 1,
-                        },
-                    ], # actions
-                }],
-                ['OS=="mac"', {
-                    'dependencies': [
-                        'copy_mesa',
-                        'LayoutTestHelper',
-                    ],
-                    'mac_bundle_resources': [
-                        '<(ahem_path)',
-                        '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf',
-                        '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf',
-                        '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher300.ttf',
-                        '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher400.ttf',
-                        '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher500.ttf',
-                        '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher600.ttf',
-                        '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher700.ttf',
-                        '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher800.ttf',
-                        '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf',
-                        '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
-                    ],
-                },{ # OS!="mac"
-                    'sources/': [
-                        # .mm is already excluded by common.gypi
-                        ['exclude', 'Mac\\.cpp$'],
-                    ],
-                }],
-                ['use_x11 == 1', {
-                    'dependencies': [
-                        '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
-                    ],
-                    'copies': [{
-                        'destination': '<(PRODUCT_DIR)',
-                        'files': [
-                            '<(ahem_path)',
-                            '../../../Tools/DumpRenderTree/chromium/fonts.conf',
-                            '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak',
-                        ]
-                    }],
-                    'variables': {
-                        # FIXME: Enable warnings on other platforms.
-                        'chromium_code': 1,
-                    },
-                    'conditions': [
-                        ['linux_use_tcmalloc == 1', {
-                            'dependencies': [
-                                '<(chromium_src_dir)/base/allocator/allocator.gyp:allocator',
-                            ],
-                        }],
-                    ],
-                },{ # use_x11 != 1
-                    'sources/': [
-                        ['exclude', 'Linux\\.cpp$']
-                    ]
-                }],
-                ['toolkit_uses_gtk == 1', {
-                    'defines': [
-                        'WTF_USE_GTK=1',
-                    ],
-                    'dependencies': [
-                        '<(chromium_src_dir)/build/linux/system.gyp:gtk',
-                    ],
-                    'include_dirs': [
-                        'public/gtk',
-                    ],
-                },{ # toolkit_uses_gtk != 1
-                    'sources/': [
-                        ['exclude', 'Gtk\\.cpp$']
-                    ]
-                }],
-                ['OS=="android"', {
-                    'dependencies': [
-                        'ImageDiff#host',
-                    ],
-                },{ # OS!="android"
-                    'dependencies': [
-                        'ImageDiff',
-                        'copy_TestNetscapePlugIn',
-                        '<(chromium_src_dir)/third_party/mesa/mesa.gyp:osmesa',
-                    ],
-                }],
-                ['inside_chromium_build==1 and component=="shared_library"', {
-                    'sources': [
-                        'src/ChromiumCurrentTime.cpp',
-                        'src/ChromiumThreading.cpp',
-                    ],
-                    'include_dirs': [
-                        'public',
-                    ],
-                    'dependencies': [
-                        '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
-                        '../../WTF/WTF.gyp/WTF.gyp:newwtf',
-                    ],
-                }],
-                ['inside_chromium_build==0', {
-                    'dependencies': [
-                        '<(chromium_src_dir)/webkit/support/setup_third_party.gyp:third_party_headers',
-                    ]
-                }],
-                ['inside_chromium_build==0 or component!="shared_library"', {
-                    'dependencies': [
-                        '../../WebCore/WebCore.gyp/WebCore.gyp:webcore_test_support',
-                    ],
-                    'include_dirs': [
-                        # WARNING: Do not view this particular case as a precedent for
-                        # including WebCore headers in DumpRenderTree project.
-                        '../../WebCore/testing/v8', # for WebCoreTestSupport.h, needed to link in window.internals code.
-                    ],
-                    'sources': [
-                        'src/WebTestingSupport.cpp',
-                        'public/WebTestingSupport.h',
-                    ],
-                }],
-            ],
-        },
-        {
-            'target_name': 'TestNetscapePlugIn',
-            'type': 'loadable_module',
-            'sources': [ '<@(test_plugin_files)' ],
-            'dependencies': [
-                '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
-            ],
-            'include_dirs': [
-                '<(chromium_src_dir)',
-                '../../../Tools/DumpRenderTree/TestNetscapePlugIn',
-                '../../../Tools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders',
-            ],
-            'conditions': [
-                ['OS=="mac"', {
-                    'mac_bundle': 1,
-                    'product_extension': 'plugin',
-                    'link_settings': {
-                        'libraries': [
-                            '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
-                            '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
-                            '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
-                        ]
-                    },
-                    'xcode_settings': {
-                        'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
-                        'INFOPLIST_FILE': '../../../Tools/DumpRenderTree/TestNetscapePlugIn/mac/Info.plist',
-                    },
-                }],
-                ['os_posix == 1 and OS != "mac"', {
-                    'cflags': [
-                        '-fvisibility=default',
-                    ],
-                }],
-                ['OS=="win"', {
-                    'defines': [
-                        # This seems like a hack, but this is what Safari Win does.
-                        'snprintf=_snprintf',
-                    ],
-                    'sources': [
-                        '../../../Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.def',
-                        '../../../Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.rc',
-                    ],
-                    # The .rc file requires that the name of the dll is npTestNetscapePlugin.dll.
-                    'product_name': 'npTestNetscapePlugin',
-                }],
-            ],
-        },
-        {
-            'target_name': 'copy_TestNetscapePlugIn',
-            'type': 'none',
-            'dependencies': [
-                'TestNetscapePlugIn',
-            ],
-            'conditions': [
-                ['OS=="win"', {
-                    'copies': [{
-                        'destination': '<(PRODUCT_DIR)/plugins',
-                        'files': ['<(PRODUCT_DIR)/npTestNetscapePlugIn.dll'],
-                    }],
-                }],
-                ['OS=="mac"', {
-                    'dependencies': ['TestNetscapePlugIn'],
-                    'copies': [{
-                        'destination': '<(PRODUCT_DIR)/plugins/',
-                        'files': ['<(PRODUCT_DIR)/TestNetscapePlugIn.plugin/'],
-                    }],
-                }],
-                ['os_posix == 1 and OS != "mac"', {
-                    'copies': [{
-                        'destination': '<(PRODUCT_DIR)/plugins',
-                        'files': ['<(PRODUCT_DIR)/libTestNetscapePlugIn.so'],
-                    }],
-                }],
-            ],
-        },
-        {
-            'target_name': 'TestWebKitAPI',
-            'type': 'executable',
-            'dependencies': [
-                'webkit',
-                '../../WebCore/WebCore.gyp/WebCore.gyp:webcore',
-                '<(chromium_src_dir)/base/base.gyp:test_support_base',
-                '<(chromium_src_dir)/testing/gtest.gyp:gtest',
-                '<(chromium_src_dir)/testing/gmock.gyp:gmock',
-                '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
-            ],
-            'include_dirs': [
-                '../../../Tools/TestWebKitAPI',
-                # Needed by tests/RunAllTests.cpp, as well as ChromiumCurrentTime.cpp and
-                # ChromiumThreading.cpp in chromium shared library configuration.
-                'public',
-            ],
-            'sources': [
-                # Reuse the same testing driver of Chromium's webkit_unit_tests.
-                'tests/RunAllTests.cpp',
-                '<@(TestWebKitAPI_files)',
-            ],
-            'conditions': [
-                ['inside_chromium_build==1 and component=="shared_library"', {
-                    'sources': [
-                        # To satisfy linking of WTF::currentTime() etc. in shared library configuration,
-                        # as the symbols are not exported from the DLLs.
-                        'src/ChromiumCurrentTime.cpp',
-                        'src/ChromiumThreading.cpp',
-                    ],
-                }],
-            ],
-        },
     ], # targets
     'conditions': [
-        ['OS=="win"', {
-            'targets': [{
-                'target_name': 'LayoutTestHelper',
-                'type': 'executable',
-                'sources': ['../../../Tools/DumpRenderTree/chromium/LayoutTestHelperWin.cpp'],
-            }],
-        }],
         ['os_posix==1 and OS!="mac" and OS!="android" and gcc_version==46', {
             'target_defaults': {
                 # Disable warnings about c++0x compatibility, as some names (such
         ['OS=="mac"', {
             'targets': [
                 {
-                    'target_name': 'LayoutTestHelper',
-                    'type': 'executable',
-                    'sources': ['../../../Tools/DumpRenderTree/chromium/LayoutTestHelper.mm'],
-                    'link_settings': {
-                        'libraries': [
-                            '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
-                        ],
-                    },
-                },
-                {
                     'target_name': 'copy_mesa',
                     'type': 'none',
                     'dependencies': ['<(chromium_src_dir)/third_party/mesa/mesa.gyp:osmesa'],
                 },
             ],
         }],
+        # FIXME: Delete this whole block once chromium's build/common.gypi
+        # is setting this flag to 0 by default. See
+        # https://bugs.webkit.org/show_bug.cgi?id=68463.
+        ['build_webkit_exes_from_webkit_gyp==1', {
+            'includes': [
+                '../../../Tools/DumpRenderTree/DumpRenderTree.gypi',
+                '../../../Tools/TestWebKitAPI/TestWebKitAPI.gypi',
+            ],
+            'targets': [
+                {
+                    'target_name': 'webkit_unit_tests',
+                    'type': 'executable',
+                    'msvs_guid': '7CEFE800-8403-418A-AD6A-2D52C6FC3EAD',
+                    'dependencies': [
+                        'webkit',
+                        '../../WebCore/WebCore.gyp/WebCore.gyp:webcore',
+                        '<(chromium_src_dir)/testing/gtest.gyp:gtest',
+                        '<(chromium_src_dir)/testing/gmock.gyp:gmock',
+                        '<(chromium_src_dir)/base/base.gyp:base',
+                        '<(chromium_src_dir)/base/base.gyp:base_i18n',
+                        '<(chromium_src_dir)/base/base.gyp:test_support_base',
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_user_agent',
+                    ],
+                    'sources': [
+                        'tests/RunAllTests.cpp',
+                    ],
+                    'include_dirs': [
+                        'public',
+                        'src',
+                    ],
+                    'conditions': [
+                        ['inside_chromium_build==1 and component=="shared_library"', {
+                            'defines': [
+                                'WEBKIT_DLL_UNITTEST',
+                            ],
+                        }, {
+                            'sources': [
+                                '<@(webkit_unittest_files)',
+                            ],
+                            'conditions': [
+                                ['toolkit_uses_gtk == 1', {
+                                    'include_dirs': [
+                                        'public/gtk',
+                                    ],
+                                    'variables': {
+                                    # FIXME: Enable warnings on other platforms.
+                                    'chromium_code': 1,
+                                    },
+                                }],
+                            ],
+                        }],
+                        ['inside_chromium_build==1 and OS=="win" and component!="shared_library"', {
+                            'configurations': {
+                                'Debug_Base': {
+                                    'msvs_settings': {
+                                        'VCLinkerTool': {
+                                            'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
+                                        },
+                                    },
+                                },
+                            },
+                        }],
+                    ],
+                },
+                {
+                    'target_name': 'ImageDiff',
+                    'type': 'executable',
+                    'dependencies': [
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support_gfx',
+                    ],
+                    'include_dirs': [
+                        '../../JavaScriptCore',
+                        '<(DEPTH)',
+                    ],
+                    'sources': [
+                        '../../../Tools/DumpRenderTree/chromium/ImageDiff.cpp',
+                    ],
+                    'conditions': [
+                        ['OS=="android"', {
+                            'toolsets': ['host'],
+                        }],
+                    ],
+                },
+                {
+                    'target_name': 'DumpRenderTree',
+                    'type': 'executable',
+                    'mac_bundle': 1,
+                    'dependencies': [
+                        'inspector_resources',
+                        'webkit',
+                        '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf_config',
+                        '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
+                        '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
+                        '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob',
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_user_agent',
+                    ],
+                    'include_dirs': [
+                        '<(chromium_src_dir)',
+                        'public',
+                        '../../JavaScriptCore',
+                        '../../JavaScriptCore/wtf', # wtf/text/*.h refers headers in wtf/ without wtf/.
+                        '<(DEPTH)',
+                    ],
+                    'defines': [
+                        # Technically not a unit test but require functions available only to
+                        # unit tests.
+                        'UNIT_TEST',
+                    ],
+                    'sources': [
+                        '<@(drt_files)',
+                    ],
+                    'conditions': [
+                        ['OS=="win"', {
+                            'dependencies': [
+                                'LayoutTestHelper',
+                                '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libEGL',
+                                '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libGLESv2',
+                            ],
+
+                            'resource_include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/webkit'],
+                            'sources': [
+                                '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
+                                '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
+                                '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc',
+                                '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc',
+                            ],
+                            'conditions': [
+                                ['inside_chromium_build==1', {
+                                    'configurations': {
+                                        'Debug_Base': {
+                                            'msvs_settings': {
+                                                'VCLinkerTool': {
+                                                    'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
+                                                },
+                                            },
+                                        },
+                                    },
+                                }],
+                            ],
+                            'copies': [{
+                                'destination': '<(PRODUCT_DIR)',
+                                'files': ['<(ahem_path)'],
+                            }],
+                        },{ # OS!="win"
+                            'sources/': [
+                                ['exclude', 'Win\\.cpp$'],
+                            ],
+                            'actions': [
+                                {
+                                    'action_name': 'repack_locale',
+                                    'variables': {
+                                        'repack_path': '<(chromium_src_dir)/tools/grit/grit/format/repack.py',
+                                        'pak_inputs': [
+                                            '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
+                                            '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.pak',
+                                            '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak',
+                                            '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
+                                            '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak',
+                                    ]},
+                                    'inputs': [
+                                        '<(repack_path)',
+                                        '<@(pak_inputs)',
+                                    ],
+                                    'outputs': [
+                                        '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak',
+                                    ],
+                                    'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
+                                    'process_outputs_as_mac_bundle_resources': 1,
+                                },
+                            ], # actions
+                        }],
+                        ['OS=="mac"', {
+                            'dependencies': [
+                                'copy_mesa',
+                                'LayoutTestHelper',
+                            ],
+                            'mac_bundle_resources': [
+                                '<(ahem_path)',
+                                '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf',
+                                '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf',
+                                '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher300.ttf',
+                                '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher400.ttf',
+                                '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher500.ttf',
+                                '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher600.ttf',
+                                '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher700.ttf',
+                                '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher800.ttf',
+                                '../../../Tools/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf',
+                                '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
+                            ],
+                        },{ # OS!="mac"
+                            'sources/': [
+                                # .mm is already excluded by common.gypi
+                                ['exclude', 'Mac\\.cpp$'],
+                            ],
+                        }],
+                        ['use_x11 == 1', {
+                            'dependencies': [
+                                '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
+                            ],
+                            'copies': [{
+                                'destination': '<(PRODUCT_DIR)',
+                                'files': [
+                                    '<(ahem_path)',
+                                    '../../../Tools/DumpRenderTree/chromium/fonts.conf',
+                                    '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak',
+                                ]
+                            }],
+                            'variables': {
+                                # FIXME: Enable warnings on other platforms.
+                                'chromium_code': 1,
+                            },
+                            'conditions': [
+                                ['linux_use_tcmalloc == 1', {
+                                    'dependencies': [
+                                        '<(chromium_src_dir)/base/allocator/allocator.gyp:allocator',
+                                    ],
+                                }],
+                            ],
+                        },{ # use_x11 != 1
+                            'sources/': [
+                                ['exclude', 'Linux\\.cpp$']
+                            ]
+                        }],
+                        ['toolkit_uses_gtk == 1', {
+                            'defines': [
+                                'WTF_USE_GTK=1',
+                            ],
+                            'dependencies': [
+                                '<(chromium_src_dir)/build/linux/system.gyp:gtk',
+                            ],
+                            'include_dirs': [
+                                'public/gtk',
+                            ],
+                        },{ # toolkit_uses_gtk != 1
+                            'sources/': [
+                                ['exclude', 'Gtk\\.cpp$']
+                            ]
+                        }],
+                        ['OS=="android"', {
+                            'dependencies': [
+                                'ImageDiff#host',
+                            ],
+                        },{ # OS!="android"
+                            'dependencies': [
+                                'ImageDiff',
+                                'copy_TestNetscapePlugIn',
+                                '<(chromium_src_dir)/third_party/mesa/mesa.gyp:osmesa',
+                            ],
+                        }],
+                        ['inside_chromium_build==1 and component=="shared_library"', {
+                            'sources': [
+                                'src/ChromiumCurrentTime.cpp',
+                                'src/ChromiumThreading.cpp',
+                            ],
+                            'include_dirs': [
+                                'public',
+                            ],
+                            'dependencies': [
+                                '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
+                                '../../WTF/WTF.gyp/WTF.gyp:newwtf',
+                            ],
+                        }],
+                        ['inside_chromium_build==0', {
+                            'dependencies': [
+                                '<(chromium_src_dir)/webkit/support/setup_third_party.gyp:third_party_headers',
+                            ]
+                        }],
+                        ['inside_chromium_build==0 or component!="shared_library"', {
+                            'dependencies': [
+                                '../../WebCore/WebCore.gyp/WebCore.gyp:webcore_test_support',
+                            ],
+                            'include_dirs': [
+                                # WARNING: Do not view this particular case as a precedent for
+                                # including WebCore headers in DumpRenderTree project.
+                                '../../WebCore/testing/v8', # for WebCoreTestSupport.h, needed to link in window.internals code.
+                            ],
+                            'sources': [
+                                'src/WebTestingSupport.cpp',
+                                'public/WebTestingSupport.h',
+                            ],
+                        }],
+                    ],
+                },
+                {
+                    'target_name': 'TestNetscapePlugIn',
+                    'type': 'loadable_module',
+                    'sources': [ '<@(test_plugin_files)' ],
+                    'dependencies': [
+                        '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
+                    ],
+                    'include_dirs': [
+                        '<(chromium_src_dir)',
+                        '../../../Tools/DumpRenderTree/TestNetscapePlugIn',
+                        '../../../Tools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders',
+                    ],
+                    'conditions': [
+                        ['OS=="mac"', {
+                            'mac_bundle': 1,
+                            'product_extension': 'plugin',
+                            'link_settings': {
+                                'libraries': [
+                                    '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
+                                    '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
+                                    '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
+                                ]
+                            },
+                            'xcode_settings': {
+                                'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
+                                'INFOPLIST_FILE': '../../../Tools/DumpRenderTree/TestNetscapePlugIn/mac/Info.plist',
+                            },
+                        }],
+                        ['os_posix == 1 and OS != "mac"', {
+                            'cflags': [
+                                '-fvisibility=default',
+                            ],
+                        }],
+                        ['OS=="win"', {
+                            'defines': [
+                                # This seems like a hack, but this is what Safari Win does.
+                                'snprintf=_snprintf',
+                            ],
+                            'sources': [
+                                '../../../Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.def',
+                                '../../../Tools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.rc',
+                            ],
+                            # The .rc file requires that the name of the dll is npTestNetscapePlugin.dll.
+                            'product_name': 'npTestNetscapePlugin',
+                        }],
+                    ],
+                },
+                {
+                    'target_name': 'copy_TestNetscapePlugIn',
+                    'type': 'none',
+                    'dependencies': [
+                        'TestNetscapePlugIn',
+                    ],
+                    'conditions': [
+                        ['OS=="win"', {
+                            'copies': [{
+                                'destination': '<(PRODUCT_DIR)/plugins',
+                                'files': ['<(PRODUCT_DIR)/npTestNetscapePlugIn.dll'],
+                            }],
+                        }],
+                        ['OS=="mac"', {
+                            'dependencies': ['TestNetscapePlugIn'],
+                            'copies': [{
+                                'destination': '<(PRODUCT_DIR)/plugins/',
+                                'files': ['<(PRODUCT_DIR)/TestNetscapePlugIn.plugin/'],
+                            }],
+                        }],
+                        ['os_posix == 1 and OS != "mac"', {
+                            'copies': [{
+                                'destination': '<(PRODUCT_DIR)/plugins',
+                                'files': ['<(PRODUCT_DIR)/libTestNetscapePlugIn.so'],
+                            }],
+                        }],
+                    ],
+                },
+                {
+                    'target_name': 'TestWebKitAPI',
+                    'type': 'executable',
+                    'dependencies': [
+                        'webkit',
+                        '../../WebCore/WebCore.gyp/WebCore.gyp:webcore',
+                        '<(chromium_src_dir)/base/base.gyp:test_support_base',
+                        '<(chromium_src_dir)/testing/gtest.gyp:gtest',
+                        '<(chromium_src_dir)/testing/gmock.gyp:gmock',
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
+                    ],
+                    'include_dirs': [
+                        '../../../Tools/TestWebKitAPI',
+                        # Needed by tests/RunAllTests.cpp, as well as ChromiumCurrentTime.cpp and
+                        # ChromiumThreading.cpp in chromium shared library configuration.
+                        'public',
+                    ],
+                    'sources': [
+                        # Reuse the same testing driver of Chromium's webkit_unit_tests.
+                        'tests/RunAllTests.cpp',
+                        '<@(TestWebKitAPI_files)',
+                    ],
+                    'conditions': [
+                        ['inside_chromium_build==1 and component=="shared_library"', {
+                            'sources': [
+                                # To satisfy linking of WTF::currentTime() etc. in shared library configuration,
+                                # as the symbols are not exported from the DLLs.
+                                'src/ChromiumCurrentTime.cpp',
+                                'src/ChromiumThreading.cpp',
+                            ],
+                        }],
+                    ],
+                },
+            ], # targets
+            'conditions': [
+                ['OS=="win"', {
+                    'targets': [{
+                        'target_name': 'LayoutTestHelper',
+                        'type': 'executable',
+                        'sources': ['../../../Tools/DumpRenderTree/chromium/LayoutTestHelperWin.cpp'],
+                    }],
+                }],
+                ['OS="mac"', {
+                    'targets': [{
+                        'target_name': 'LayoutTestHelper',
+                        'type': 'executable',
+                        'sources': ['../../../Tools/DumpRenderTree/chromium/LayoutTestHelper.mm'],
+                        'link_settings': {
+                            'libraries': [
+                                '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
+                            ],
+                        },
+                    }],
+                }],
+            ],
+        }],
     ], # conditions
 }
-
-# Local Variables:
-# tab-width:2
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=2 shiftwidth=2:
diff --git a/Source/WebKit/chromium/WebKitUnitTests.gyp b/Source/WebKit/chromium/WebKitUnitTests.gyp
new file mode 100644 (file)
index 0000000..eb76224
--- /dev/null
@@ -0,0 +1,124 @@
+#
+# Copyright (C) 2011 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#         * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#         * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#         * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+{
+    # FIXME: Remove this conditional check once chromium's
+    # build/common.gypi is setting this flag to 0 by default. See
+    # https://bugs.webkit.org/show_bug.cgi?id=68463. 
+    'conditions': [
+        ['build_webkit_exes_from_webkit_gyp==0', {
+            'includes': [
+                'features.gypi',
+                'WebKit.gypi',
+            ],
+            'variables': {
+                'conditions': [
+                    # Location of the chromium src directory and target type is different
+                    # if webkit is built inside chromium or as standalone project.
+                    ['inside_chromium_build==0', {
+                        # Webkit is being built outside of the full chromium project.
+                        # e.g. via build-webkit --chromium
+                        'chromium_src_dir': '../../WebKit/chromium',
+                    },{
+                        # WebKit is checked out in src/chromium/third_party/WebKit
+                        'chromium_src_dir': '../../../../..',
+                    }],
+                ],
+            },
+            'targets': [
+                {
+                    'target_name': 'webkit_unit_tests',
+                    'type': 'executable',
+                    'msvs_guid': '7CEFE800-8403-418A-AD6A-2D52C6FC3EAD',
+                    'dependencies': [
+                        'WebKit.gyp:webkit',
+                        '../../WebCore/WebCore.gyp/WebCore.gyp:webcore',
+                        '<(chromium_src_dir)/testing/gtest.gyp:gtest',
+                        '<(chromium_src_dir)/testing/gmock.gyp:gmock',
+                        '<(chromium_src_dir)/base/base.gyp:base',
+                        '<(chromium_src_dir)/base/base.gyp:base_i18n',
+                        '<(chromium_src_dir)/base/base.gyp:test_support_base',
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_user_agent',
+                    ],
+                    'sources': [
+                        'tests/RunAllTests.cpp',
+                    ],
+                    'include_dirs': [
+                        'public',
+                        'src',
+                    ],
+                    'conditions': [
+                        ['inside_chromium_build==1 and component=="shared_library"', {
+                            'defines': [
+                                'WEBKIT_DLL_UNITTEST',
+                            ],
+                        }, {
+                            'sources': [
+                                '<@(webkit_unittest_files)',
+                            ],
+                            'conditions': [
+                                ['toolkit_uses_gtk == 1', {
+                                    'include_dirs': [
+                                        'public/gtk',
+                                    ],
+                                    'variables': {
+                                    # FIXME: Enable warnings on other platforms.
+                                    'chromium_code': 1,
+                                    },
+                                }],
+                            ],
+                        }],
+                        ['inside_chromium_build==1 and OS=="win" and component!="shared_library"', {
+                            'configurations': {
+                                'Debug_Base': {
+                                    'msvs_settings': {
+                                        'VCLinkerTool': {
+                                            'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
+                                        },
+                                    },
+                                },
+                            },
+                        }],
+                    ],
+                }                
+            ], # targets
+            'conditions': [
+                ['os_posix==1 and OS!="mac" and OS!="android" and gcc_version==46', {
+                    'target_defaults': {
+                        # Disable warnings about c++0x compatibility, as some names (such
+                        # as nullptr) conflict with upcoming c++0x types.
+                        'cflags_cc': ['-Wno-c++0x-compat'],
+                    },
+                }],
+            ],
+        }],
+    ],
+}
index 0961e9b..69facff 100755 (executable)
@@ -120,6 +120,7 @@ if __name__ == '__main__':
                '-Dv8_use_snapshot=false',
                '-Dmsvs_use_common_release=0',
                '-Ddisable_nacl=1',
+               '-Dbuild_webkit_exes_from_webkit_gyp=0',
 
                # WebKit doesn't use the chromium style checker.
                '-Dmake_clang_dir=Source/WebKit/chromium/third_party/llvm-build/Release+Asserts',
@@ -129,7 +130,7 @@ if __name__ == '__main__':
                '--depth=./',
 
                # gyp file to execute.
-               'WebKit.gyp'])
+               'All.gyp'])
 
   print 'Updating webkit projects from gyp files...'
   sys.stdout.flush()
index fb2816e..5a40a27 100644 (file)
@@ -1,3 +1,20 @@
+2011-12-06  Dirk Pranke  <dpranke@chromium.org>
+
+        binaries in webkit.gyp should be split into a new file to break circular dependencies on webkit_support
+        https://bugs.webkit.org/show_bug.cgi?id=73382
+
+        Reviewed by Tony Chang.
+
+        XCode (and hence GYP) can't handle circular dependencies between
+        files (and projects). Accordingly, although the binaries in
+        WebKit.gyp depend on webkit_support and webkit_support depends
+        on webkit, we don't mention the latter dependency in the file.
+        To fix this, this change moves the binaries like DRT into a new
+        GYP file, and modifies gyp_webkit to build from that file
+        instead of WebKit.gyp.
+
+        * Tools.gyp: Added.
+
 2011-12-06  Adam Roben  <aroben@apple.com>
 
         Add a pid parameter to CrashLogs.find_newest_log
diff --git a/Tools/Tools.gyp b/Tools/Tools.gyp
new file mode 100644 (file)
index 0000000..f5a0785
--- /dev/null
@@ -0,0 +1,387 @@
+#
+# Copyright (C) 2011 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#         * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#         * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#         * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+{
+    # FIXME: Remove this conditional check once chromium's
+    # build/common.gypi is setting this flag to 0 by default. See
+    # https://bugs.webkit.org/show_bug.cgi?id=68463.
+    'conditions': [
+         ['build_webkit_exes_from_webkit_gyp==0', {
+            'includes': [
+                'DumpRenderTree/DumpRenderTree.gypi',
+                '../Source/WebKit/chromium/features.gypi',
+            ],
+            'variables': {
+                'conditions': [
+                    # Location of the chromium src directory and target type is different
+                    # if webkit is built inside chromium or as standalone project.
+                    ['inside_chromium_build==0', {
+                        # Webkit is being built outside of the full chromium project.
+                        # e.g. via build-webkit --chromium
+                        'chromium_src_dir': '../Source/WebKit/chromium',
+                    },{
+                        # WebKit is checked out in src/chromium/third_party/WebKit
+                        'chromium_src_dir': '../../..',
+                    }],
+                ],
+                'ahem_path': 'DumpRenderTree/qt/fonts/AHEM____.TTF',
+            },
+            'targets': [
+                {
+                    'target_name': 'ImageDiff',
+                    'type': 'executable',
+                    'dependencies': [
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support_gfx',
+                    ],
+                    'include_dirs': [
+                        '../Source/JavaScriptCore',
+                        '<(DEPTH)',
+                    ],
+                    'sources': [
+                        'DumpRenderTree/chromium/ImageDiff.cpp',
+                    ],
+                    'conditions': [
+                        ['OS=="android"', {
+                            'toolsets': ['host'],
+                        }],
+                    ],
+                },
+                {
+                    'target_name': 'DumpRenderTree',
+                    'type': 'executable',
+                    'mac_bundle': 1,
+                    'dependencies': [
+                        '../Source/WebKit/chromium/WebKit.gyp:inspector_resources',
+                        '../Source/WebKit/chromium/WebKit.gyp:webkit',
+                        '../Source/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf_config',
+                        '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
+                        '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
+                        '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob',
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
+                        '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_user_agent',
+                    ],
+                    'include_dirs': [
+                        '<(chromium_src_dir)',
+                        '../Source/WebKit/chromium/public',
+                        '../Source/JavaScriptCore',
+                        '../Source/JavaScriptCore/wtf', # wtf/text/*.h refers headers in wtf/ without wtf/.
+                        '<(DEPTH)',
+                    ],
+                    'defines': [
+                        # Technically not a unit test but require functions available only to
+                        # unit tests.
+                        'UNIT_TEST',
+                    ],
+                    'sources': [
+                        '<@(drt_files)',
+                    ],
+                    'conditions': [
+                        ['OS=="win"', {
+                            'dependencies': [
+                                'LayoutTestHelper',
+                                '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libEGL',
+                                '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libGLESv2',
+                            ],
+
+                            'resource_include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/webkit'],
+                            'sources': [
+                                '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
+                                '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
+                                '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc',
+                                '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc',
+                            ],
+                            'conditions': [
+                                ['inside_chromium_build==1', {
+                                    'configurations': {
+                                        'Debug_Base': {
+                                            'msvs_settings': {
+                                                'VCLinkerTool': {
+                                                    'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
+                                                },
+                                            },
+                                        },
+                                    },
+                                }],
+                            ],
+                            'copies': [{
+                                'destination': '<(PRODUCT_DIR)',
+                                'files': ['<(ahem_path)'],
+                            }],
+                        },{ # OS!="win"
+                            'sources/': [
+                                ['exclude', 'Win\\.cpp$'],
+                            ],
+                            'actions': [
+                                {
+                                    'action_name': 'repack_locale',
+                                    'variables': {
+                                        'repack_path': '<(chromium_src_dir)/tools/grit/grit/format/repack.py',
+                                        'pak_inputs': [
+                                            '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
+                                            '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.pak',
+                                            '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak',
+                                            '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
+                                            '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak',
+                                    ]},
+                                    'inputs': [
+                                        '<(repack_path)',
+                                        '<@(pak_inputs)',
+                                    ],
+                                    'outputs': [
+                                        '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak',
+                                    ],
+                                    'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
+                                    'process_outputs_as_mac_bundle_resources': 1,
+                                },
+                            ], # actions
+                        }],
+                        ['OS=="mac"', {
+                            'dependencies': [
+                                '../Source/WebKit/chromium/WebKit.gyp:copy_mesa',
+                                'LayoutTestHelper',
+                            ],
+                            'mac_bundle_resources': [
+                                '<(ahem_path)',
+                                'DumpRenderTree/fonts/WebKitWeightWatcher100.ttf',
+                                'DumpRenderTree/fonts/WebKitWeightWatcher200.ttf',
+                                'DumpRenderTree/fonts/WebKitWeightWatcher300.ttf',
+                                'DumpRenderTree/fonts/WebKitWeightWatcher400.ttf',
+                                'DumpRenderTree/fonts/WebKitWeightWatcher500.ttf',
+                                'DumpRenderTree/fonts/WebKitWeightWatcher600.ttf',
+                                'DumpRenderTree/fonts/WebKitWeightWatcher700.ttf',
+                                'DumpRenderTree/fonts/WebKitWeightWatcher800.ttf',
+                                'DumpRenderTree/fonts/WebKitWeightWatcher900.ttf',
+                                '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
+                            ],
+                        },{ # OS!="mac"
+                            'sources/': [
+                                # .mm is already excluded by common.gypi
+                                ['exclude', 'Mac\\.cpp$'],
+                            ],
+                        }],
+                        ['use_x11 == 1', {
+                            'dependencies': [
+                                '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
+                            ],
+                            'copies': [{
+                                'destination': '<(PRODUCT_DIR)',
+                                'files': [
+                                    '<(ahem_path)',
+                                    'DumpRenderTree/chromium/fonts.conf',
+                                    '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak',
+                                ]
+                            }],
+                            'variables': {
+                                # FIXME: Enable warnings on other platforms.
+                                'chromium_code': 1,
+                            },
+                            'conditions': [
+                                ['linux_use_tcmalloc == 1', {
+                                    'dependencies': [
+                                        '<(chromium_src_dir)/base/allocator/allocator.gyp:allocator',
+                                    ],
+                                }],
+                            ],
+                        },{ # use_x11 != 1
+                            'sources/': [
+                                ['exclude', 'Linux\\.cpp$']
+                            ]
+                        }],
+                        ['toolkit_uses_gtk == 1', {
+                            'defines': [
+                                'WTF_USE_GTK=1',
+                            ],
+                            'dependencies': [
+                                '<(chromium_src_dir)/build/linux/system.gyp:gtk',
+                            ],
+                            'include_dirs': [
+                                '../Source/WebKit/chromium/public/gtk',
+                            ],
+                        },{ # toolkit_uses_gtk != 1
+                            'sources/': [
+                                ['exclude', 'Gtk\\.cpp$']
+                            ]
+                        }],
+                        ['OS=="android"', {
+                            'dependencies': [
+                                'ImageDiff#host',
+                            ],
+                        },{ # OS!="android"
+                            'sources/': [
+                                ['exclude', '(Android)\\.cpp$']
+                            ],
+                            'dependencies': [
+                                'ImageDiff',
+                                'copy_TestNetscapePlugIn',
+                                '<(chromium_src_dir)/third_party/mesa/mesa.gyp:osmesa',
+                            ],
+                        }],
+                        ['inside_chromium_build==1 and component=="shared_library"', {
+                            'sources': [
+                                '../Source/WebKit/chromium/src/ChromiumCurrentTime.cpp',
+                                '../Source/WebKit/chromium/src/ChromiumThreading.cpp',
+                            ],
+                            'include_dirs': [
+                                '../Source/WebKit/chromium/public',
+                            ],
+                            'dependencies': [
+                                '../Source/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
+                                '../Source/WTF/WTF.gyp/WTF.gyp:newwtf',
+                            ],
+                        }],
+                        ['inside_chromium_build==0', {
+                            'dependencies': [
+                                '<(chromium_src_dir)/webkit/support/setup_third_party.gyp:third_party_headers',
+                            ]
+                        }],
+                        ['inside_chromium_build==0 or component!="shared_library"', {
+                            'dependencies': [
+                                '../Source/WebCore/WebCore.gyp/WebCore.gyp:webcore_test_support',
+                            ],
+                            'include_dirs': [
+                                # WARNING: Do not view this particular case as a precedent for
+                                # including WebCore headers in DumpRenderTree project.
+                                '../Source/WebCore/testing/v8', # for WebCoreTestSupport.h, needed to link in window.internals code.
+                            ],
+                            'sources': [
+                                '../Source/WebKit/chromium/src/WebTestingSupport.cpp',
+                                '../Source/WebKit/chromium/public/WebTestingSupport.h',
+                            ],
+                        }],
+                    ],
+                },
+                {
+                    'target_name': 'TestNetscapePlugIn',
+                    'type': 'loadable_module',
+                    'sources': [ '<@(test_plugin_files)' ],
+                    'dependencies': [
+                        '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
+                    ],
+                    'include_dirs': [
+                        '<(chromium_src_dir)',
+                        'DumpRenderTree/TestNetscapePlugIn',
+                        'DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders',
+                    ],
+                    'conditions': [
+                        ['OS=="mac"', {
+                            'mac_bundle': 1,
+                            'product_extension': 'plugin',
+                            'link_settings': {
+                                'libraries': [
+                                    '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
+                                    '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
+                                    '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
+                                ]
+                            },
+                            'xcode_settings': {
+                                'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
+                                'INFOPLIST_FILE': 'DumpRenderTree/TestNetscapePlugIn/mac/Info.plist',
+                            },
+                        }],
+                        ['os_posix == 1 and OS != "mac"', {
+                            'cflags': [
+                                '-fvisibility=default',
+                            ],
+                        }],
+                        ['OS=="win"', {
+                            'defines': [
+                                # This seems like a hack, but this is what Safari Win does.
+                                'snprintf=_snprintf',
+                            ],
+                            'sources': [
+                                'DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.def',
+                                'DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.rc',
+                            ],
+                            # The .rc file requires that the name of the dll is npTestNetscapePlugin.dll.
+                            'product_name': 'npTestNetscapePlugin',
+                        }],
+                    ],
+                },
+                {
+                    'target_name': 'copy_TestNetscapePlugIn',
+                    'type': 'none',
+                    'dependencies': [
+                        'TestNetscapePlugIn',
+                    ],
+                    'conditions': [
+                        ['OS=="win"', {
+                            'copies': [{
+                                'destination': '<(PRODUCT_DIR)/plugins',
+                                'files': ['<(PRODUCT_DIR)/npTestNetscapePlugIn.dll'],
+                            }],
+                        }],
+                        ['OS=="mac"', {
+                            'dependencies': ['TestNetscapePlugIn'],
+                            'copies': [{
+                                'destination': '<(PRODUCT_DIR)/plugins/',
+                                'files': ['<(PRODUCT_DIR)/TestNetscapePlugIn.plugin/'],
+                            }],
+                        }],
+                        ['os_posix == 1 and OS != "mac"', {
+                            'copies': [{
+                                'destination': '<(PRODUCT_DIR)/plugins',
+                                'files': ['<(PRODUCT_DIR)/libTestNetscapePlugIn.so'],
+                            }],
+                        }],
+                    ],
+                },
+            ], # targets
+            'conditions': [
+                ['OS=="win"', {
+                    'targets': [{
+                        'target_name': 'LayoutTestHelper',
+                        'type': 'executable',
+                        'sources': ['DumpRenderTree/chromium/LayoutTestHelperWin.cpp'],
+                    }],
+                }],
+                ['OS=="mac"', {
+                    'targets': [{
+                        'target_name': 'LayoutTestHelper',
+                        'type': 'executable',
+                        'sources': ['DumpRenderTree/chromium/LayoutTestHelper.mm'],
+                        'link_settings': {
+                            'libraries': [
+                                '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
+                            ],
+                        },
+                    }],
+                }],
+                ['os_posix==1 and OS!="mac" and gcc_version==46', {
+                    'target_defaults': {
+                        # Disable warnings about c++0x compatibility, as some names (such
+                        # as nullptr) conflict with upcoming c++0x types.
+                        'cflags_cc': ['-Wno-c++0x-compat'],
+                    },
+                }],
+            ], # conditions
+        }],
+    ],
+}