Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: build/config/BUILD.gn

Issue 2152783002: Enable precompiled headers for Blink on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaning up comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | build/config/pch.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/allocator.gni") 5 import("//build/config/allocator.gni")
6 import("//build/config/chrome_build.gni") 6 import("//build/config/chrome_build.gni")
7 import("//build/config/chromecast_build.gni") 7 import("//build/config/chromecast_build.gni")
8 import("//build/config/crypto.gni") 8 import("//build/config/crypto.gni")
9 import("//build/config/dcheck_always_on.gni") 9 import("//build/config/dcheck_always_on.gni")
10 import("//build/config/features.gni") 10 import("//build/config/features.gni")
11 import("//build/config/pch.gni")
11 import("//build/config/sanitizers/sanitizers.gni") 12 import("//build/config/sanitizers/sanitizers.gni")
12 import("//build/config/ui.gni") 13 import("//build/config/ui.gni")
13 import("//build/toolchain/goma.gni") 14 import("//build/toolchain/goma.gni")
14 15
15 # One common error that happens is that GYP-generated headers within gen/ get 16 # One common error that happens is that GYP-generated headers within gen/ get
16 # included rather than the GN-generated ones within gen/ subdirectories. 17 # included rather than the GN-generated ones within gen/ subdirectories.
17 # TODO(GYP_GONE): Remove once GYP is gone (as well as exec_script exception). 18 # TODO(GYP_GONE): Remove once GYP is gone (as well as exec_script exception).
18 assert( 19 assert(
19 exec_script("//build/dir_exists.py", [ "obj.host" ], "string") == "False", 20 exec_script("//build/dir_exists.py", [ "obj.host" ], "string") == "False",
20 "GYP artifacts detected in $root_build_dir.$0x0A" + 21 "GYP artifacts detected in $root_build_dir.$0x0A" +
21 "You must wipe this directory before building with GN.") 22 "You must wipe this directory before building with GN.")
22 23
23 declare_args() { 24 declare_args() {
24 # When set (the default) enables C++ iterator debugging in debug builds. 25 # When set (the default) enables C++ iterator debugging in debug builds.
25 # Iterator debugging is always off in release builds (technically, this flag 26 # Iterator debugging is always off in release builds (technically, this flag
26 # affects the "debug" config, which is always available but applied by 27 # affects the "debug" config, which is always available but applied by
27 # default only in debug builds). 28 # default only in debug builds).
28 # 29 #
29 # Iterator debugging is generally useful for catching bugs. But it can 30 # Iterator debugging is generally useful for catching bugs. But it can
30 # introduce extra locking to check the state of an iterator against the state 31 # introduce extra locking to check the state of an iterator against the state
31 # of the current object. For iterator- and thread-heavy code, this can 32 # of the current object. For iterator- and thread-heavy code, this can
32 # significantly slow execution. 33 # significantly slow execution.
33 enable_iterator_debugging = true 34 enable_iterator_debugging = true
34
35 # Normally we try to decide whether to use precompiled headers or
36 # not based on the other build arguments, but in some cases it is
37 # easiest to force them off explicitly.
38 disable_precompiled_headers = false
39 } 35 }
40 36
41 # TODO(brettw) Most of these should be removed. Instead of global feature 37 # TODO(brettw) Most of these should be removed. Instead of global feature
42 # flags, we should have more modular flags that apply only to a target and its 38 # flags, we should have more modular flags that apply only to a target and its
43 # dependents. For example, depending on the "x11" meta-target should define 39 # dependents. For example, depending on the "x11" meta-target should define
44 # USE_X11 for all dependents so that everything that could use X11 gets the 40 # USE_X11 for all dependents so that everything that could use X11 gets the
45 # define, but anything that doesn't depend on X11 doesn't see it. 41 # define, but anything that doesn't depend on X11 doesn't see it.
46 # 42 #
47 # For now we define these globally to match the current GYP build. 43 # For now we define these globally to match the current GYP build.
48 config("feature_flags") { 44 config("feature_flags") {
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 424
429 # Add this config to your target to enable precompiled headers. 425 # Add this config to your target to enable precompiled headers.
430 # 426 #
431 # Precompiled headers are done on a per-target basis. If you have just a couple 427 # Precompiled headers are done on a per-target basis. If you have just a couple
432 # of files, the time it takes to precompile (~2 seconds) can actually be longer 428 # of files, the time it takes to precompile (~2 seconds) can actually be longer
433 # than the time saved. On a Z620, a 100 file target compiles about 2 seconds 429 # than the time saved. On a Z620, a 100 file target compiles about 2 seconds
434 # faster with precompiled headers, with greater savings for larger targets. 430 # faster with precompiled headers, with greater savings for larger targets.
435 # 431 #
436 # Recommend precompiled headers for targets with more than 50 .cc files. 432 # Recommend precompiled headers for targets with more than 50 .cc files.
437 config("precompiled_headers") { 433 config("precompiled_headers") {
438 if (!is_official_build && !use_goma && !disable_precompiled_headers) { 434 if (!disable_precompiled_headers) {
439 if (is_win) { 435 if (is_win) {
440 # This is a string rather than a file GN knows about. It has to match 436 # This is a string rather than a file GN knows about. It has to match
441 # exactly what's in the /FI flag below, and what might appear in the 437 # exactly what's in the /FI flag below, and what might appear in the
442 # source code in quotes for an #include directive. 438 # source code in quotes for an #include directive.
443 precompiled_header = "build/precompile.h" 439 precompiled_header = "build/precompile.h"
444 440
445 # This is a file that GN will compile with the above header. It will be 441 # This is a file that GN will compile with the above header. It will be
446 # implicitly added to the sources (potentially multiple times, with one 442 # implicitly added to the sources (potentially multiple times, with one
447 # variant for each language used in the target). 443 # variant for each language used in the target).
448 precompiled_source = "//build/precompile.cc" 444 precompiled_source = "//build/precompile.cc"
(...skipping 10 matching lines...) Expand all
459 # file doesn't exist, no error will be generated (probably MS tested this 455 # file doesn't exist, no error will be generated (probably MS tested this
460 # case but forgot the other one?). To reproduce this error, do a build, 456 # case but forgot the other one?). To reproduce this error, do a build,
461 # then delete the precompile.c.obj file, then build again. 457 # then delete the precompile.c.obj file, then build again.
462 cflags_c = [ "/wd4206" ] 458 cflags_c = [ "/wd4206" ]
463 } else if (is_mac) { 459 } else if (is_mac) {
464 precompiled_header = "build/precompile.h" 460 precompiled_header = "build/precompile.h"
465 precompiled_source = "//build/precompile.h" 461 precompiled_source = "//build/precompile.h"
466 } 462 }
467 } 463 }
468 } 464 }
OLDNEW
« no previous file with comments | « no previous file | build/config/pch.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698