OLD | NEW |
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/features.gni") | 9 import("//build/config/features.gni") |
10 import("//build/config/sanitizers/sanitizers.gni") | 10 import("//build/config/sanitizers/sanitizers.gni") |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 # Add this config to your target to enable precompiled headers. | 431 # Add this config to your target to enable precompiled headers. |
432 # | 432 # |
433 # Precompiled headers are done on a per-target basis. If you have just a couple | 433 # Precompiled headers are done on a per-target basis. If you have just a couple |
434 # of files, the time it takes to precompile (~2 seconds) can actually be longer | 434 # of files, the time it takes to precompile (~2 seconds) can actually be longer |
435 # than the time saved. On a Z620, a 100 file target compiles about 2 seconds | 435 # than the time saved. On a Z620, a 100 file target compiles about 2 seconds |
436 # faster with precompiled headers, with greater savings for larger targets. | 436 # faster with precompiled headers, with greater savings for larger targets. |
437 # | 437 # |
438 # Recommend precompiled headers for targets with more than 50 .cc files. | 438 # Recommend precompiled headers for targets with more than 50 .cc files. |
439 config("precompiled_headers") { | 439 config("precompiled_headers") { |
440 if (!is_official_build && !use_goma && !disable_precompiled_headers) { | 440 if (!is_official_build && !use_goma && !disable_precompiled_headers) { |
441 # TODO(thakis): Reenable on clang after https://crbug.com/605570 is fixed. | 441 if (is_win) { |
442 if (is_win && !is_clang) { | |
443 # This is a string rather than a file GN knows about. It has to match | 442 # This is a string rather than a file GN knows about. It has to match |
444 # exactly what's in the /FI flag below, and what might appear in the | 443 # exactly what's in the /FI flag below, and what might appear in the |
445 # source code in quotes for an #include directive. | 444 # source code in quotes for an #include directive. |
446 precompiled_header = "build/precompile.h" | 445 precompiled_header = "build/precompile.h" |
447 | 446 |
448 # This is a file that GN will compile with the above header. It will be | 447 # This is a file that GN will compile with the above header. It will be |
449 # implicitly added to the sources (potentially multiple times, with one | 448 # implicitly added to the sources (potentially multiple times, with one |
450 # variant for each language used in the target). | 449 # variant for each language used in the target). |
451 precompiled_source = "//build/precompile.cc" | 450 precompiled_source = "//build/precompile.cc" |
452 | 451 |
453 # Force include the header. | 452 # Force include the header. |
454 cflags = [ "/FI$precompiled_header" ] | 453 cflags = [ "/FI$precompiled_header" ] |
455 | 454 |
456 # Disable warning for "this file was empty after preprocessing". This | 455 # Disable warning for "this file was empty after preprocessing". This |
457 # error is generated only in C mode for ANSI compatibility. It conflicts | 456 # error is generated only in C mode for ANSI compatibility. It conflicts |
458 # with precompiled headers since the source file that's "compiled" for | 457 # with precompiled headers since the source file that's "compiled" for |
459 # making the precompiled header is empty. | 458 # making the precompiled header is empty. |
460 # | 459 # |
461 # This error doesn't happen every time. In VS2013, it seems if the .pch | 460 # This error doesn't happen every time. In VS2013, it seems if the .pch |
462 # file doesn't exist, no error will be generated (probably MS tested this | 461 # file doesn't exist, no error will be generated (probably MS tested this |
463 # case but forgot the other one?). To reproduce this error, do a build, | 462 # case but forgot the other one?). To reproduce this error, do a build, |
464 # then delete the precompile.c.obj file, then build again. | 463 # then delete the precompile.c.obj file, then build again. |
465 cflags_c = [ "/wd4206" ] | 464 cflags_c = [ "/wd4206" ] |
466 } else if (is_mac) { | 465 } else if (is_mac) { |
467 precompiled_header = "build/precompile.h" | 466 precompiled_header = "build/precompile.h" |
468 precompiled_source = "//build/precompile.h" | 467 precompiled_source = "//build/precompile.h" |
469 } | 468 } |
470 } | 469 } |
471 } | 470 } |
OLD | NEW |