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

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

Issue 1292983004: [GN]: Precompiled header support for GCC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/toolchain/mac/BUILD.gn » ('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/crypto.gni") 7 import("//build/config/crypto.gni")
8 import("//build/config/features.gni") 8 import("//build/config/features.gni")
9 import("//build/config/sanitizers/sanitizers.gni") 9 import("//build/config/sanitizers/sanitizers.gni")
10 import("//build/config/ui.gni") 10 import("//build/config/ui.gni")
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 "CoreText.framework", 410 "CoreText.framework",
411 "Foundation.framework", 411 "Foundation.framework",
412 ] 412 ]
413 } else if (is_linux) { 413 } else if (is_linux) {
414 libs = [ "dl" ] 414 libs = [ "dl" ]
415 } 415 }
416 } 416 }
417 417
418 # Add this config to your target to enable precompiled headers. 418 # Add this config to your target to enable precompiled headers.
419 # 419 #
420 # On Windows, precompiled headers are done on a per-target basis. If you have 420 # Precompiled headers are done on a per-target basis. If you have just a couple
421 # just a couple of files, the time it takes to precompile (~2 seconds) can 421 # of files, the time it takes to precompile (~2 seconds) can actually be longer
422 # actually be longer than the time saved. On a Z620, a 100 file target compiles 422 # than the time saved. On a Z620, a 100 file target compiles about 2 seconds
423 # about 2 seconds faster with precompiled headers, with greater savings for 423 # faster with precompiled headers, with greater savings for larger targets.
424 # larger targets.
425 # 424 #
426 # Recommend precompiled headers for targets with more than 50 .cc files. 425 # Recommend precompiled headers for targets with more than 50 .cc files.
427 config("precompiled_headers") { 426 config("precompiled_headers") {
428 if (is_win && !is_official_build && !use_goma) { 427 if (is_win && !is_official_build && !use_goma) {
429 # This is a string rather than a file GN knows about. It has to match 428 # This is a string rather than a file GN knows about. It has to match
430 # exactly what's in the /FI flag below, and what might appear in the source 429 # exactly what's in the /FI flag below, and what might appear in the source
431 # code in quotes for an #include directive. 430 # code in quotes for an #include directive.
432 precompiled_header = "build/precompile.h" 431 precompiled_header = "build/precompile.h"
433 432
434 # This is a file that GN will compile with the above header. It will be 433 # This is a file that GN will compile with the above header. It will be
435 # implicitly added to the sources (potentially multiple times, with one 434 # implicitly added to the sources (potentially multiple times, with one
436 # variant for each language used in the target). 435 # variant for each language used in the target).
437 precompiled_source = "//build/precompile.cc" 436 precompiled_source = "//build/precompile.cc"
438 437
439 # Force include the header. 438 # Force include the header.
440 cflags = [ "/FI$precompiled_header" ] 439 cflags = [ "/FI$precompiled_header" ]
441 440
442 # Disable warning for "this file was empty after preprocessing". This 441 # Disable warning for "this file was empty after preprocessing". This
443 # error is generated only in C mode for ANSI compatibility. It conflicts 442 # error is generated only in C mode for ANSI compatibility. It conflicts
444 # with precompiled headers since the source file that's "compiled" for 443 # with precompiled headers since the source file that's "compiled" for
445 # making the precompiled header is empty. 444 # making the precompiled header is empty.
446 # 445 #
447 # This error doesn't happen every time. In VS2013, it seems if the .pch 446 # This error doesn't happen every time. In VS2013, it seems if the .pch
448 # file doesn't exist, no error will be generated (probably MS tested this 447 # file doesn't exist, no error will be generated (probably MS tested this
449 # case but forgot the other one?). To reproduce this error, do a build, 448 # case but forgot the other one?). To reproduce this error, do a build,
450 # then delete the precompile.c.obj file, then build again. 449 # then delete the precompile.c.obj file, then build again.
451 cflags_c = [ "/wd4206" ] 450 cflags_c = [ "/wd4206" ]
451 } else if (is_mac && !is_official_build && !use_goma) {
452 # TODO:(andybons): enable this when GCC PCH support in the binary has been
453 # rolled.
454 #precompiled_header = "build/precompile.h"
455 #precompiled_source = "//build/precompile.h"
452 } 456 }
453 } 457 }
OLDNEW
« no previous file with comments | « no previous file | build/toolchain/mac/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698