Enable use of precompiled headers in Chromium port on Windows.
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 19:00:36 +0000 (19:00 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jan 2012 19:00:36 +0000 (19:00 +0000)
Bug 76381 - Use precompiled headers in Chromium port on Windows
https://bugs.webkit.org/show_bug.cgi?id=76381

Patch by Joi Sigurdsson <joi@chromium.org> on 2012-01-19
Reviewed by Tony Chang.

Source/JavaScriptCore:

* JavaScriptCore.gyp/JavaScriptCore.gyp: Include WinPrecompile.gypi.

Source/Platform:

* Platform.gyp/Platform.gyp: Include WinPrecompile.gypi.

Source/WebCore:

No new tests needed; if the change builds and existing tests pass
that should provide enough coverage.

* WebCore.gyp/WebCore.gyp: Include WinPrecompile.gypi.

Source/WebKit/chromium:

* WebKit.gyp: Include WinPrecompile.gypi.
* WinPrecompile.cpp: Added.
* WinPrecompile.gypi: Added.
* WinPrecompile.h: Added.

Source/WTF:

* WTF.gyp/WTF.gyp: Include WinPrecompile.gypi.

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

13 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp
Source/Platform/ChangeLog
Source/Platform/Platform.gyp/Platform.gyp
Source/WTF/ChangeLog
Source/WTF/WTF.gyp/WTF.gyp
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gyp/WebCore.gyp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gyp
Source/WebKit/chromium/WinPrecompile.cpp [new file with mode: 0644]
Source/WebKit/chromium/WinPrecompile.gypi [new file with mode: 0644]
Source/WebKit/chromium/WinPrecompile.h [new file with mode: 0644]

index 46c03dc..85cd0a2 100644 (file)
@@ -1,3 +1,14 @@
+2012-01-19  Joi Sigurdsson  <joi@chromium.org>
+
+        Enable use of precompiled headers in Chromium port on Windows.
+
+        Bug 76381 - Use precompiled headers in Chromium port on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=76381
+
+        Reviewed by Tony Chang.
+
+        * JavaScriptCore.gyp/JavaScriptCore.gyp: Include WinPrecompile.gypi.
+
 2012-01-18  Roland Takacs  <takacs.roland@stud.u-szeged.hu>
 
         Cross-platform processor core counter fix
index 259bd08..90aecb7 100644 (file)
@@ -1,10 +1,10 @@
 #
 # Copyright (C) 2009, 2012 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
@@ -14,7 +14,7 @@
 #     * 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
@@ -30,6 +30,7 @@
 
 {
   'includes': [
+    '../../WebKit/chromium/WinPrecompile.gypi',
     # FIXME: Sense whether upstream or downstream build, and
     # include the right features.gypi
     '../../WebKit/chromium/features.gypi',
@@ -66,7 +67,7 @@
         'defines': [
           # Import features_defines from features.gypi
           '<@(feature_defines)',
-          
+
           # Turns on #if PLATFORM(CHROMIUM)
           'BUILDING_CHROMIUM__=1',
           # Controls wtf/FastMalloc
         ['exclude', '../'],
         # ... Then include what we want.
         ['include', '../wtf/'],
-        # FIXME: This is clearly not sustainable. 
-        ['exclude', '../wtf/efl'], 
-        ['exclude', '../wtf/gobject'], 
-        ['exclude', '../wtf/gtk'], 
-        ['exclude', '../wtf/mac'], 
-        ['exclude', '../wtf/qt'], 
-        ['exclude', '../wtf/url'], 
-        ['exclude', '../wtf/wince'], 
-        ['exclude', '../wtf/wx'], 
-        ['exclude', '../wtf/unicode/wince'], 
-        ['exclude', '../wtf/unicode/glib'], 
-        ['exclude', '../wtf/unicode/qt4'], 
+        # FIXME: This is clearly not sustainable.
+        ['exclude', '../wtf/efl'],
+        ['exclude', '../wtf/gobject'],
+        ['exclude', '../wtf/gtk'],
+        ['exclude', '../wtf/mac'],
+        ['exclude', '../wtf/qt'],
+        ['exclude', '../wtf/url'],
+        ['exclude', '../wtf/wince'],
+        ['exclude', '../wtf/wx'],
+        ['exclude', '../wtf/unicode/wince'],
+        ['exclude', '../wtf/unicode/glib'],
+        ['exclude', '../wtf/unicode/qt4'],
         # GLib/GTK, even though its name doesn't really indicate.
         ['exclude', '/(gtk|glib|gobject)/.*\\.(cpp|h)$'],
         ['exclude', '(Default|Gtk|Mac|None|Qt|Win|Wx|Efl|Symbian)\\.(cpp|mm)$'],
index df2fe31..fc45347 100644 (file)
@@ -1,3 +1,14 @@
+2012-01-19  Joi Sigurdsson  <joi@chromium.org>
+
+        Enable use of precompiled headers in Chromium port on Windows.
+
+        Bug 76381 - Use precompiled headers in Chromium port on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=76381
+
+        Reviewed by Tony Chang.
+
+        * Platform.gyp/Platform.gyp: Include WinPrecompile.gypi.
+
 2012-01-04  James Robinson  <jamesr@chromium.org>
 
         [chromium] Compile fix, rename libplatform.a to libwebkit_platform.a to avoid collision with nacl
index 94c8259..d3d4bbe 100644 (file)
@@ -30,6 +30,7 @@
 
 {
     'includes': [
+        '../../WebKit/chromium/WinPrecompile.gypi',
         '../Platform.gypi',
     ],
     'targets': [
index a960c83..e2ae353 100644 (file)
@@ -1,3 +1,14 @@
+2012-01-19  Joi Sigurdsson  <joi@chromium.org>
+
+        Enable use of precompiled headers in Chromium port on Windows.
+
+        Bug 76381 - Use precompiled headers in Chromium port on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=76381
+
+        Reviewed by Tony Chang.
+
+        * WTF.gyp/WTF.gyp: Include WinPrecompile.gypi.
+
 2012-01-18  Roland Takacs  <takacs.roland@stud.u-szeged.hu>
 
         Cross-platform processor core counter
index 5759432..5fe7611 100644 (file)
@@ -1,5 +1,4 @@
-#
-# Copyright (C) 2011 Google Inc. All rights reserved.
+# Copyright (C) 2012 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
@@ -28,6 +27,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 {
   'includes': [
+    '../../WebKit/chromium/WinPrecompile.gypi',
     '../../WebKit/chromium/features.gypi',
     '../WTF.gypi',
   ],
index 5bdafb4..11efa4a 100755 (executable)
@@ -1,3 +1,17 @@
+2012-01-19  Joi Sigurdsson  <joi@chromium.org>
+
+        Enable use of precompiled headers in Chromium port on Windows.
+
+        Bug 76381 - Use precompiled headers in Chromium port on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=76381
+
+        Reviewed by Tony Chang.
+
+        No new tests needed; if the change builds and existing tests pass
+        that should provide enough coverage.
+
+        * WebCore.gyp/WebCore.gyp: Include WinPrecompile.gypi.
+
 2012-01-19  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Web Inspector: Switching tabs in TabbedEditorContainer should reveal selected script in navigator.
index 7497cb8..3b9715c 100644 (file)
@@ -30,6 +30,7 @@
 
 {
   'includes': [
+    '../../WebKit/chromium/WinPrecompile.gypi',
     # FIXME: Sense whether upstream or downstream build, and
     # include the right features.gypi
     '../../WebKit/chromium/features.gypi',
index f132d17..31e9fbc 100644 (file)
@@ -1,3 +1,17 @@
+2012-01-19  Joi Sigurdsson  <joi@chromium.org>
+
+        Enable use of precompiled headers in Chromium port on Windows.
+
+        Bug 76381 - Use precompiled headers in Chromium port on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=76381
+
+        Reviewed by Tony Chang.
+
+        * WebKit.gyp: Include WinPrecompile.gypi.
+        * WinPrecompile.cpp: Added.
+        * WinPrecompile.gypi: Added.
+        * WinPrecompile.h: Added.
+
 2012-01-18  Kinuko Yasuda  <kinuko@chromium.org>
 
         Cleanup: Move chrome-specific filesystem type handling code (for FileSystem API) under chromium directory
index 5c1254a..03b2c46 100644 (file)
@@ -30,6 +30,7 @@
 
 {
     'includes': [
+        'WinPrecompile.gypi',
         '../../WebCore/WebCore.gypi',
         'WebKit.gypi',
         'features.gypi',
diff --git a/Source/WebKit/chromium/WinPrecompile.cpp b/Source/WebKit/chromium/WinPrecompile.cpp
new file mode 100644 (file)
index 0000000..6482416
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+/*
+ * Precompiled header generator for Windows builds. No include is needed
+ * in this file as the PCH include is forced via the "Forced Include File"
+ * flag in the projects generated by GYP.
+ */
diff --git a/Source/WebKit/chromium/WinPrecompile.gypi b/Source/WebKit/chromium/WinPrecompile.gypi
new file mode 100644 (file)
index 0000000..fcb21f2
--- /dev/null
@@ -0,0 +1,53 @@
+# Copyright (C) 2012 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.
+
+# Include this file to make targets in your .gyp use the default precompiled
+# header on Windows, when precompiled headers are turned on.
+
+{
+  'conditions': [
+      ['OS=="win" and chromium_win_pch==1', {
+          'variables': {
+              'conditions': [
+                  # We need to calculate the path to the gyp directory differently depending on whether we are
+                  # being built stand-alone (via build-webkit --chromium) or as part of the Chromium checkout.
+                  ['inside_chromium_build==0', {
+                      'win_pch_dir': '<(DEPTH)/../../WebKit/chromium',
+                  },{
+                      'win_pch_dir': '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium',
+                  }],
+              ]
+          },
+          'target_defaults': {
+              'msvs_precompiled_header': '<(win_pch_dir)/WinPrecompile.h',
+              'msvs_precompiled_source': '<(win_pch_dir)/WinPrecompile.cpp',
+              'sources': ['<(win_pch_dir)/WinPrecompile.cpp'],
+          }
+      }],
+  ],
+}
diff --git a/Source/WebKit/chromium/WinPrecompile.h b/Source/WebKit/chromium/WinPrecompile.h
new file mode 100644 (file)
index 0000000..c30811c
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+/*
+ * Precompiled header for WebKit when built on Windows using
+ * GYP-generated project files.  Not used by other build
+ * configurations.
+ *
+ * Using precompiled headers speeds the build up significantly.  On a
+ * fast machine (HP Z600, 12 GB of RAM), an ~18% decrease in full
+ * build time was measured.
+ */
+
+#if defined(WinPrecompile_h_)
+#error You shouldn't include the precompiled header file more than once.
+#endif
+
+#define WinPrecompile_h_
+
+#include <Windows.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <math.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include <algorithm>
+#include <limits>
+#include <string>
+#include <utility>