Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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("config.gni") | 5 import("config.gni") |
| 6 if (is_clang) { | 6 if (is_clang) { |
| 7 import("//build/config/clang/clang.gni") | 7 import("//build/config/clang/clang.gni") |
| 8 } | 8 } |
| 9 | 9 |
| 10 visibility = [ "//third_party/WebKit/*" ] | 10 visibility = [ "//third_party/WebKit/*" ] |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 | 34 |
| 35 # inside_blink ----------------------------------------------------------------- | 35 # inside_blink ----------------------------------------------------------------- |
| 36 | 36 |
| 37 config("inside_blink") { | 37 config("inside_blink") { |
| 38 defines = [ | 38 defines = [ |
| 39 "BLINK_IMPLEMENTATION=1", | 39 "BLINK_IMPLEMENTATION=1", |
| 40 "INSIDE_BLINK", | 40 "INSIDE_BLINK", |
| 41 ] | 41 ] |
| 42 } | 42 } |
| 43 | 43 |
| 44 # blink_pch -------------------------------------------------------------------- | |
| 45 | |
| 46 # Precompiled headers can save a lot of time compiling since Blink has | |
| 47 # a lot of source in header files. | |
| 48 | |
| 49 import("//build/config/pch.gni") | |
| 50 | |
| 51 config("blink_pch") { | |
| 52 if (!disable_precompiled_headers) { | |
| 53 if (is_win) { | |
| 54 # This is a string rather than a file GN knows about. It has to match | |
| 55 # exactly what's in the /FI flag below, and what might appear in the | |
| 56 # source code in quotes for an #include directive. | |
| 57 precompiled_header = rebase_path("build/win/Precompile.h", root_build_dir) | |
| 58 | |
| 59 # This is a file that GN will compile with the above header. It will be | |
| 60 # implicitly added to the sources (potentially multiple times, with one | |
| 61 # variant for each language used in the target). | |
| 62 precompiled_source = | |
| 63 "//third_party/WebKit/Source/build/win/Precompile.cpp" | |
| 64 | |
| 65 # Force include the header. | |
| 66 cflags = [ "/FI$precompiled_header" ] | |
| 67 | |
| 68 # Disable warning for "this file was empty after preprocessing". This | |
| 69 # error is generated only in C mode for ANSI compatibility. It conflicts | |
| 70 # with precompiled headers since the source file that's "compiled" for | |
| 71 # making the precompiled header is empty. | |
| 72 # | |
| 73 # This error doesn't happen every time. In VS2013, it seems if the .pch | |
|
Nico
2016/11/21 15:42:25
Since this mentions 2013 -- do we still need this
sof
2016/11/21 19:24:58
Hard to conclusively say; I would prefer to handle
| |
| 74 # file doesn't exist, no error will be generated (probably MS tested this | |
| 75 # case but forgot the other one?). To reproduce this error, do a build, | |
| 76 # then delete the precompile.c.obj file, then build again. | |
| 77 cflags_c = [ "/wd4206" ] | |
| 78 } | |
| 79 } | |
| 80 } | |
| 81 | |
| 44 # config ----------------------------------------------------------------------- | 82 # config ----------------------------------------------------------------------- |
| 45 | 83 |
| 46 config("config") { | 84 config("config") { |
| 47 include_dirs = [ | 85 include_dirs = [ |
| 48 ".", | 86 ".", |
| 49 "..", | 87 "..", |
| 50 "$root_gen_dir/blink", | 88 "$root_gen_dir/blink", |
| 51 "$root_gen_dir/third_party/WebKit", | 89 "$root_gen_dir/third_party/WebKit", |
| 52 ] | 90 ] |
| 53 | 91 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 } | 162 } |
| 125 } | 163 } |
| 126 | 164 |
| 127 if (is_mac) { | 165 if (is_mac) { |
| 128 # This sets up precompiled headers for Mac. | 166 # This sets up precompiled headers for Mac. |
| 129 config("mac_precompiled_headers") { | 167 config("mac_precompiled_headers") { |
| 130 precompiled_header = rebase_path("build/mac/Prefix.h", root_build_dir) | 168 precompiled_header = rebase_path("build/mac/Prefix.h", root_build_dir) |
| 131 precompiled_source = "//third_party/WebKit/Source/build/mac/Prefix.h" | 169 precompiled_source = "//third_party/WebKit/Source/build/mac/Prefix.h" |
| 132 } | 170 } |
| 133 } | 171 } |
| OLD | NEW |