summaryrefslogtreecommitdiffstats
path: root/build/precompile.h
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-07-27 12:45:25 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-27 19:46:54 +0000
commit8f3218985dde74063ccc362da47803be163f3165 (patch)
tree177bd60384bfb8dc03fe439e82ff6f6061fdf59a /build/precompile.h
parent258deb0a1977629e17c135a03080061ef9d1535b (diff)
downloadchromium_src-8f3218985dde74063ccc362da47803be163f3165.zip
chromium_src-8f3218985dde74063ccc362da47803be163f3165.tar.gz
chromium_src-8f3218985dde74063ccc362da47803be163f3165.tar.bz2
Add precompiled headers to GN build for large targets.
Turns on precompiled header support in the GN build on Windows, and adds the precompiled header config to most large-ish targets in the build. Removes Windows files from the precompiled header. This does not seem to affect the build speed much because most Chrome files don't depend on Windows any more. And windows.h injects typedefs and defines that conflict with some third party libraries and prevent using precompiled headers for those targets or any target that includes them. I counted ~50 files or bigger as large. The 50 file threshold is based on some previous approximate measurements (since the precompile step is an extra per-target compile, it can actually make small targets compile slower). For borderline cases, I added the precompiled header flag if I thought it was likely to have more files added, and didn't add it if I thought the target was likely to be static. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1250273002 Cr-Commit-Position: refs/heads/master@{#340535}
Diffstat (limited to 'build/precompile.h')
-rw-r--r--build/precompile.h86
1 files changed, 17 insertions, 69 deletions
diff --git a/build/precompile.h b/build/precompile.h
index 32c2f11..50a9b87 100644
--- a/build/precompile.h
+++ b/build/precompile.h
@@ -2,17 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Precompiled header for Chromium project on Windows, not used by
-// other build configurations. Using precompiled headers speeds the
-// build up significantly, around 1/4th on VS 2010 on an HP Z600 with 12
-// GB of memory.
-//
-// Numeric comments beside includes are the number of times they were
-// included under src/chrome/browser on 2011/8/20, which was used as a
-// baseline for deciding what to include in the PCH. Includes without
-// a numeric comment are generally included at least 5 times. It may
-// be possible to tweak the speed of the build by commenting out or
-// removing some of the less frequently used headers.
+// This file is used as a precompiled header for both C and C++ files. So
+// any C++ headers must go in the __cplusplus block below.
#if defined(BUILD_PRECOMPILE_H_)
#error You shouldn't include the precompiled header file more than once.
@@ -22,83 +13,38 @@
#define _USE_MATH_DEFINES
-// The Windows header needs to come before almost all the other
-// Windows-specific headers.
-#include <Windows.h>
-#include <dwmapi.h>
-#include <shellapi.h>
-#include <wtypes.h> // 2
-
-// Defines in atlbase.h cause conflicts; if we could figure out how
-// this family of headers can be included in the PCH, it might speed
-// up the build as several of them are used frequently.
-/*
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlcom.h>
-#include <atlcrack.h> // 2
-#include <atlctrls.h> // 2
-#include <atlmisc.h> // 2
-#include <atlsafe.h> // 1
-#include <atltheme.h> // 1
-#include <atlwin.h> // 2
-*/
-
-// Objbase.h and other files that rely on it bring in [ #define
-// interface struct ] which can cause problems in a multi-platform
-// build like Chrome's. #undef-ing it does not work as there are
-// currently 118 targets that break if we do this, so leaving out of
-// the precompiled header for now.
-//#include <commctrl.h> // 2
-//#include <commdlg.h> // 3
-//#include <cryptuiapi.h> // 2
-//#include <Objbase.h> // 2
-//#include <objidl.h> // 1
-//#include <ole2.h> // 1
-//#include <oleacc.h> // 2
-//#include <oleauto.h> // 1
-//#include <oleidl.h> // 1
-//#include <propkey.h> // 2
-//#include <propvarutil.h> // 2
-//#include <pstore.h> // 2
-//#include <shlguid.h> // 1
-//#include <shlwapi.h> // 1
-//#include <shobjidl.h> // 4
-//#include <urlhist.h> // 2
-
-// Caused other conflicts in addition to the 'interface' issue above.
-// #include <shlobj.h>
-
#include <errno.h>
#include <fcntl.h>
-#include <limits.h> // 4
+#include <limits.h>
#include <math.h>
-#include <memory.h> // 1
+#include <memory.h>
#include <signal.h>
-#include <stdarg.h> // 1
+#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h> // 4
+#include <time.h>
+
+#if defined(__cplusplus)
#include <algorithm>
-#include <bitset> // 3
+#include <bitset>
#include <cmath>
#include <cstddef>
-#include <cstdio> // 3
-#include <cstdlib> // 2
+#include <cstdio>
+#include <cstdlib>
#include <cstring>
#include <deque>
-#include <fstream> // 3
+#include <fstream>
#include <functional>
-#include <iomanip> // 2
-#include <iosfwd> // 2
+#include <iomanip>
+#include <iosfwd>
#include <iterator>
#include <limits>
#include <list>
#include <map>
-#include <numeric> // 2
+#include <numeric>
#include <ostream>
#include <queue>
#include <set>
@@ -107,3 +53,5 @@
#include <string>
#include <utility>
#include <vector>
+
+#endif // __cplusplus