Skip to content

Commit

Permalink
Use precompiled headers on Windows only when a flag is set.
Browse files Browse the repository at this point in the history
I would have preferred if precompiled headers could be enabled by
default. The motivation for this change is primarily that Visual
Studio does the wrong thing on preprocessor flag changes - instead of
rebuilding precompiled headers, it errors out on any file that uses
them, saying that the precompiled header was built with different
flags! This causes a world of hurt on our infrastructure stuff,
particularly on trybots as they may be jumping back and forth between
revisions before and after a flag change.

Prior to this change, only Debug builds used precompiled headers and
Release builds did not. The reason Release builds did not was that
official builds were running out of memory with precompiled headers
enabled. The distinction of Debug vs. Release is no longer necessary
after the flag is added, so removing that extra bit of complexity from
the .gyp files.

BUG=none
TEST=it builds


Review URL: http://codereview.chromium.org/8041022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102839 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
joi@chromium.org committed Sep 27, 2011
1 parent 9afb541 commit d5cf9fb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 27 deletions.
10 changes: 9 additions & 1 deletion build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@
# For example, use_xi2_mt=2 means XI2.2 or above version is required.
'use_xi2_mt%': 0,

# Use of precompiled headers on Windows is off by default
# because of complications that it can cause with our
# infrastructure (trybots etc.). Enable by setting to 1 in
# ~/.gyp/include.gypi or via the GYP command line for ~20-25%
# faster builds.
'chromium_win_pch%': 0,

'conditions': [
# TODO(epoger): Figure out how to set use_skia=1 for Mac outside of
# the 'conditions' clause. Initial attempts resulted in chromium and
Expand Down Expand Up @@ -336,6 +343,7 @@
'remoting%': '<(remoting)',
'use_threaded_compositing%': '<(use_threaded_compositing)',
'enable_webrtc%': '<(enable_webrtc)',
'chromium_win_pch%': '<(chromium_win_pch)',
'p2p_apis%': '<(p2p_apis)',
'configuration_policy%': '<(configuration_policy)',
'safe_browsing%': '<(safe_browsing)',
Expand Down Expand Up @@ -630,7 +638,7 @@
],
# Enable to use system sqlite.
'use_system_sqlite%': '<(android_build_type)',
# Enable to use system libjpeg.
# Enable to use system libjpeg.
'use_system_libjpeg%': '<(android_build_type)',
# Enable to use the system libexpat.
'use_system_libexpat%': '<(android_build_type)',
Expand Down
14 changes: 3 additions & 11 deletions build/win_precompile.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,10 @@

{
'conditions': [
['OS=="win"', {
['OS=="win" and chromium_win_pch==1', {
'target_defaults': {
'configurations': {
'Debug': {
'msvs_precompiled_header': '<(DEPTH)/build/precompile.h',
'msvs_precompiled_source': '<(DEPTH)/build/precompile.cc',
},
},

# Sources can't be specified inside the 'Debug'
# configuration. Since precompile.cc only contains
# comments, it won't have any effect for 'Release' builds.
'msvs_precompiled_header': '<(DEPTH)/build/precompile.h',
'msvs_precompiled_source': '<(DEPTH)/build/precompile.cc',
'sources': ['<(DEPTH)/build/precompile.cc'],
}
}],
Expand Down
21 changes: 6 additions & 15 deletions chrome/installer/mini_installer.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,12 @@
{
'target_name': 'mini_installer',
'type': 'executable',
'configurations': {
'Debug': {
# Disable precompiled headers for this project, to avoid
# linker errors when building with VS 2008.
#
# Note that putting this in the 'target_defaults'
# section earlier in the file does not successfully
# override the 'target_defaults' brought in by the
# build/win_precompile.gypi file, so the overriding
# needs to be done here, directly in the mini_installer
# target.
'msvs_precompiled_header': '',
'msvs_precompiled_source': '',
},
},

# Disable precompiled headers for this project, to avoid
# linker errors when building with VS 2008.
'msvs_precompiled_header': '',
'msvs_precompiled_source': '',

'sources': [
'mini_installer/chrome.release',
'mini_installer/chrome_appid.cc',
Expand Down

0 comments on commit d5cf9fb

Please sign in to comment.